/* Teams Directory Page Styles */

.teams-page-container {
    width: 100%;
    margin: 0 auto;
    padding-bottom: 0;
}

.teams-header {
    padding: 0 0 16px;
    margin-bottom: 14px;
    width: 100%;
}

.teams-header-inner {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.teams-header-title {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 900;
    line-height: 1.1;
    color: var(--ice-white);
    text-wrap: balance;
}

/* Simple Search Toolbar */
.teams-search-bar-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto 22px;
    width: 100%;
}

.teams-search-bar-container .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    width: 100%;
    max-width: 520px;
}

.teams-search-bar-container .search-icon {
    position: absolute;
    left: 20px;
    color: #9fb0c7;
    pointer-events: none;
    transition: color 0.22s ease;
}

.teams-search-bar-container .filter-input {
    width: 100%;
    min-height: 42px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--ice-white);
    padding: 8px 20px 8px 46px;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.teams-search-bar-container .filter-input:hover {
    border-color: rgba(245, 197, 66, 0.25);
    background-color: rgba(15, 23, 42, 0.65);
}

.teams-search-bar-container .filter-input:focus {
    border-color: var(--victory-gold);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(245, 197, 66, 0.15);
    background-color: rgba(15, 23, 42, 0.75);
}

.teams-search-bar-container .search-input-wrapper:focus-within .search-icon {
    color: var(--victory-gold);
}

.teams-toolbar-results {
    flex-shrink: 0;
}

.directory-count {
    font-size: 0.95rem;
    color: #9fb0c7;
    font-weight: 500;
}

.directory-count strong {
    color: var(--ice-white);
    font-weight: 800;
}

/* Centered Teams Grid Layout - Centers final row leftovers perfectly */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
}

/* Redesigned Team Profile Card - Centered, Premium, and logo-forward */
.team-directory-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--team-accent);
    border-radius: 12px;
    padding: 24px 20px;
    min-height: 430px;
    text-decoration: none;
    position: relative;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, border-top-width 0.22s ease, box-shadow 0.22s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.team-directory-card:hover {
    border-color: rgba(245, 197, 66, 0.45);
    border-top-width: 4px;
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(245, 197, 66, 0.03), 0 0 0 1px rgba(245, 197, 66, 0.1);
}

/* Card Top Area */
.team-card-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
}

.team-card-logo-container {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.team-mark {
    margin: 0;
}

.team-mark-badge {
    width: 90px !important;
    height: 90px !important;
    border-radius: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border: 2px solid rgba(255, 255, 255, 0.08) !important;
    transition: border-color 0.2s ease !important;
}

/* Dynamic background based on logo presence */
.team-mark-badge:has(img) {
    background: rgba(8, 14, 25, 0.45) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

.team-mark-badge:not(:has(img)) {
    background: linear-gradient(145deg, var(--team-primary), var(--team-secondary)) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.team-mark-badge img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
    padding: 6px !important;
}

.team-monogram {
    font-size: 1.7rem !important;
    font-weight: 900 !important;
    color: var(--ice-white) !important;
    letter-spacing: 0.02em !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.team-status-badge {
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--ice-white);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-block;
}

/* Team Identity */
.team-card-identity {
    margin-bottom: 14px;
    width: 100%;
}

.team-card-name {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--ice-white);
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

/* Centered Record Stat */
.team-card-primary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
}

.stat-number {
    font-size: 2.1rem;
    font-weight: 900;
    color: var(--ice-white);
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--victory-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Key Stats Row (PTS, Rank, Roster formatted inline) */
.team-card-stats-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 22px;
}

.stat-box {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-box-val {
    font-size: 1.05rem;
    font-weight: 850;
    color: var(--ice-white);
}

.stat-box-lbl {
    font-size: 0.74rem;
    font-weight: 700;
    color: #9fb0c7;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Compact Management Rows */
.team-card-management {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.mgmt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    width: 100%;
}

.mgmt-label {
    color: var(--victory-gold, #FACC15);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.mgmt-val {
    color: var(--ice-white, #F8FAFC);
    font-weight: 800;
    min-width: 0;
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* CTA Footer (Centered view link) */
.team-card-footer {
    margin-top: auto;
    width: 100%;
}

.team-card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--victory-gold);
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: gap 0.2s ease, color 0.2s ease;
}

.cta-arrow {
    transition: transform 0.2s ease;
}

.team-directory-card:hover .team-card-cta {
    color: var(--ice-white);
}

.team-directory-card:hover .cta-arrow {
    transform: translateX(4px);
}

/* Empty Notes */
.teams-no-results {
    text-align: center;
    color: #9fb0c7;
    font-size: 1.1rem;
    padding: 36px 0;
    font-weight: 500;
}

.no-teams-panel {
    text-align: center;
    padding: 36px 24px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.empty-note {
    color: #9fb0c7;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

/* Mobile Search Layout Customizations */
@media (max-width: 680px) {
    .team-directory-card {
        min-height: 0;
    }

    .team-card-stats-row {
        gap: 14px;
    }

    .mgmt-row {
        gap: 12px;
    }

    .mgmt-val {
        max-width: 62%;
    }

    .teams-search-bar-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .teams-header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
    
    .teams-search-bar-container .search-input-wrapper {
        max-width: 100%;
    }
    
    .teams-toolbar-results {
        text-align: center;
    }
}
