/* NXTRUNN Run Club Directory - New Coaches Corner Design */

:root {
    --nxtrunn-purple: #8f657c;
    --nxtrunn-purple-dark: #6B5B7B;
    --nxtrunn-accent-1: #b69baa;
    --nxtrunn-accent-2: #a9899b;
    --nxtrunn-accent-3: #9c778b;
}

/* Directory Wrapper */
.nxtrunn-directory-wrapper-new {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header with Search + Add Button */
.nxtrunn-header-new {
    background: white;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 1rem 1.5rem; /* Increased from 1rem to 1.5rem */
}

.nxtrunn-search-add-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.nxtrunn-search-wrapper {
    position: relative;
    flex: 1;
}

.nxtrunn-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
}

.nxtrunn-search-input-new {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid #e5e5e5;
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nxtrunn-search-input-new:focus {
    outline: none;
    border-color: var(--nxtrunn-purple);
    box-shadow: 0 0 0 3px rgba(143, 101, 124, 0.1);
}

.nxtrunn-clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
}

.nxtrunn-clear-search svg {
    width: 1.25rem;
    height: 1.25rem;
}

.nxtrunn-add-club-btn {
    padding: 0.75rem 1.5rem;
    background: var(--nxtrunn-purple);
    color: white;
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.nxtrunn-add-club-btn:hover {
    box-shadow: 0 4px 12px rgba(143, 101, 124, 0.3);
    transform: translateY(-2px);
}

/* Filter Pills */
.nxtrunn-filters-new {
    background: white;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 76px;
    z-index: 30;
    padding: 1rem 1.5rem; /* Increased from 1rem to 1.5rem */
}

.nxtrunn-filter-pills-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nxtrunn-filter-pills-container::-webkit-scrollbar {
    display: none;
}

.nxtrunn-filter-pill {
    padding: 0.5rem 1.5rem;
    border: 2px solid #d1d5db;
    border-radius: 9999px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1;
}

.nxtrunn-filter-pill svg {
    width: 1rem;
    height: 1rem;
}

.nxtrunn-filter-pill:hover {
    border-color: var(--nxtrunn-purple);
}

.nxtrunn-filter-pill.active {
    background: var(--nxtrunn-purple);
    border-color: var(--nxtrunn-purple);
    color: white;
}

/* Dropdown */
.nxtrunn-filter-dropdown {
    position: relative;
}

.nxtrunn-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nxtrunn-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    width: 16rem;
    z-index: 50;
    padding: 0.5rem;
}

.nxtrunn-dropdown-menu.active {
    display: block;
}

.nxtrunn-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.nxtrunn-dropdown-item:hover {
    background-color: #f3f4f6;
}

/* Results Count */
.nxtrunn-results-count-new {
    padding: 1rem 1.5rem; /* Increased from 1rem to 1.5rem */
    color: #6b7280;
    font-size: 0.875rem;
}

.nxtrunn-results-count-new .count {
    font-weight: 600;
}

/* Club Cards Grid */
.nxtrunn-directory-grid-new {
    padding: 1rem 1rem 3rem 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 100%;
}

@media (min-width: 768px) {
    .nxtrunn-directory-grid-new {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1.5rem 2rem 3rem 2rem;
    }
}

/* Club Card - Horizontal Layout */
.nxtrunn-club-card {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s;
}

@media (min-width: 768px) {
    .nxtrunn-club-card {
        padding: 1.25rem;
    }
}

.nxtrunn-club-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.nxtrunn-club-card-content {
    display: flex;
    gap: 1rem;
}

.nxtrunn-club-photo {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .nxtrunn-club-photo {
        width: 140px;
        height: 140px;
    }
}

.nxtrunn-club-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nxtrunn-club-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--nxtrunn-purple) 0%, var(--nxtrunn-accent-1) 100%);
}

.nxtrunn-club-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.nxtrunn-club-name {
    font-size: 1.125rem;
    font-weight: bold;
    color: #111827;
    margin: 0 0 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nxtrunn-club-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.nxtrunn-club-location svg {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
}

.nxtrunn-club-location span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nxtrunn-club-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.nxtrunn-badge {
    padding: 0.125rem 0.5rem !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: white !important;
    text-transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    line-height: 1 !important;
    height: auto !important;
    vertical-align: middle !important;
    transform: scale(0.75) !important;
    transform-origin: left center !important;
    margin-right: -0.25rem !important;
}

.nxtrunn-badge-woman,
.nxtrunn-badge-bipoc {
    /* Badges already scaled by parent rule */
}

.nxtrunn-badge-woman {
    background: linear-gradient(135deg, #E91E63 0%, #F48FB1 100%) !important;
}

.nxtrunn-badge-bipoc {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%) !important;
}

.nxtrunn-badge-sponsor {
    background: linear-gradient(135deg, #2196F3 0%, #64B5F6 100%) !important;
}

.nxtrunn-club-preview {
    font-size: 0.75rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nxtrunn-club-view-btn {
    width: 100%;
    padding: 0.5rem;
    background: var(--nxtrunn-purple);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.nxtrunn-club-view-btn:hover {
    box-shadow: 0 4px 12px rgba(143, 101, 124, 0.3);
}

/* Empty State */
.nxtrunn-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.nxtrunn-empty-state svg {
    width: 6rem;
    height: 6rem;
    margin: 0 auto 1rem;
    color: #d1d5db;
}

.nxtrunn-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.nxtrunn-empty-state p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.nxtrunn-clear-all-btn {
    padding: 0.5rem 1.5rem;
    background: var(--nxtrunn-purple);
    color: white;
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
}

/* Modal */
.nxtrunn-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

@media (min-width: 768px) {
    .nxtrunn-modal-backdrop {
        align-items: center;
        padding: 1rem;
    }
}

.nxtrunn-modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 42rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    touch-action: pan-y;
}

@media (max-width: 767px) {
    .nxtrunn-modal-content {
        border-radius: 1rem 1rem 0 0;
        max-height: 90vh;
        width: 100%;
        margin: 0;
    }
}

.nxtrunn-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e5e5e5;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    pointer-events: auto;
}

.nxtrunn-modal-close:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    transform: scale(1.05);
}

.nxtrunn-modal-close svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
    color: #1f2937 !important;
    stroke: currentColor !important;
    stroke-width: 2.5 !important;
    pointer-events: none;
    display: block !important;
}

.nxtrunn-modal-body {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .nxtrunn-modal-body {
        padding: 2rem;
    }
}

/* Modal - Club Photo */
.nxtrunn-modal-photo {
    height: 16rem;
    background: #f9f9f9;
    border-radius: 1rem 1rem 0 0;
    overflow: hidden;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .nxtrunn-modal-photo {
        height: 20rem;
        margin: -2rem -2rem 2rem -2rem;
    }
}

.nxtrunn-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.nxtrunn-modal-photo-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--nxtrunn-purple) 0%, var(--nxtrunn-accent-1) 100%);
}

/* Modal - Content */
.nxtrunn-modal-header h2 {
    font-size: 1.875rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 0.5rem;
}

.nxtrunn-modal-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.nxtrunn-modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.nxtrunn-modal-badges .nxtrunn-badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.nxtrunn-modal-quick-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.nxtrunn-modal-quick-info svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

.nxtrunn-modal-section {
    margin-bottom: 1.5rem;
}

.nxtrunn-modal-section h3 {
    font-size: 1.125rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 0.75rem;
}

.nxtrunn-modal-section p {
    color: #4b5563;
    line-height: 1.6;
}

.nxtrunn-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nxtrunn-modal-tag {
    padding: 0.25rem 0.75rem;
    background: #f3e8ff;
    color: #7c3aed;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.nxtrunn-modal-sponsor {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nxtrunn-modal-sponsor img {
    height: 3rem;
    object-fit: contain;
}

.nxtrunn-modal-sponsor span {
    font-weight: 600;
    color: #4b5563;
}

.nxtrunn-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

@media (min-width: 640px) {
    .nxtrunn-modal-actions {
        flex-direction: row;
    }
}

.nxtrunn-modal-actions a,
.nxtrunn-modal-actions button {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.nxtrunn-submit-link {
    background: var(--nxtrunn-purple);
    color: white;
    border: none;
}

.nxtrunn-submit-link:hover {
    box-shadow: 0 4px 12px rgba(143, 101, 124, 0.3);
}

.nxtrunn-instagram-link {
    background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    color: white;
    border: none;
}

.nxtrunn-cancel-btn {
    background: white;
    color: #4b5563;
    border: 2px solid #d1d5db;
}

.nxtrunn-cancel-btn:hover {
    border-color: #9ca3af;
}

/* Add Club Modal */
.nxtrunn-add-modal .nxtrunn-modal-body h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 1rem;
}

.nxtrunn-add-modal .nxtrunn-modal-body p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Loading Spinner */
.nxtrunn-loading-new {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.nxtrunn-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #f3f4f6;
    border-top-color: var(--nxtrunn-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nxtrunn-club-card {
    animation: fadeInUp 0.4s ease-out;
}
