/* ==========================================================================
   OFFICIAL BUNDESLIGA CLUBS DIRECTORY DESIGN SYSTEM (web/portfolio)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800;900&display=swap');

.bvb-directory-page {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #0b0d12;
    color: #e2e8f0;
    padding: 40px 0 70px 0;
    min-height: 85vh;
}

/* Header Section */
.bvb-dir-header {
    background: linear-gradient(135deg, #11141f 0%, #080a0e 100%);
    border-radius: 20px;
    padding: 40px 35px;
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.bvb-dir-title-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bvb-dir-title-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #dc052d 0%, #a0001e 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(220,5,45,0.4);
}

.bvb-dir-title {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
    line-height: 1.1;
}

.bvb-dir-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 4px 0 0 0;
}

.bvb-dir-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.bvb-meta-torneo {
    color: #38bdf8;
    font-size: 0.92rem;
    font-weight: 700;
}

.bvb-meta-cat {
    display: inline-block;
    white-space: nowrap;
    color: #ffffff;
    font-weight: 800;
    font-size: 11.5px;
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.45);
    padding: 2px 9px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.bvb-meta-count {
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Search Bar */
.bvb-dir-search-wrap {
    position: relative;
    width: 320px;
    max-width: 100%;
}

.bvb-dir-search-input {
    width: 100%;
    background: #191d2a;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 25px;
    padding: 10px 20px 10px 45px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.bvb-dir-search-input:focus {
    border-color: #dc052d;
    box-shadow: 0 0 16px rgba(220,5,45,0.35);
    background: #1e2333;
}

.bvb-dir-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
}

/* Grid Layout - Modern compact density */
.bvb-clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

/* Individual Official Bundesliga Club Card */
.bvb-club-card-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
    height: 100%;
}

.bvb-club-card {
    background: linear-gradient(180deg, #161a26 0%, #10121a 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 2px solid var(--club-primary, #dc052d);
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 2px 12px var(--club-alpha, rgba(220,5,45,0.12));
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

/* Top Club Brand Stripe (Uses team primary color) */
.bvb-club-card-stripe {
    height: 3px;
    width: 100%;
    background-color: var(--club-primary, #dc052d);
    box-shadow: 0 2px 10px var(--club-glow, rgba(220,5,45,0.5));
    transition: height 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 3;
}

/* Dynamic 3D Ambient Top Glow reflecting Club Crest / Shield Colors */
.bvb-club-card-top-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140%;
    height: 110px;
    background: radial-gradient(ellipse at 50% 0%, var(--club-glow, rgba(56, 189, 248, 0.45)) 0%, var(--club-alpha, rgba(56, 189, 248, 0.16)) 50%, transparent 80%);
    pointer-events: none;
    z-index: 1;
    opacity: 0.75;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.bvb-club-card-body {
    padding: 22px 16px 18px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

/* Crest Image Container */
.bvb-club-crest-wrap {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.bvb-club-crest-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Club Name & Location Tag */
.bvb-club-name {
    font-size: 1.08rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #ffffff;
    letter-spacing: -0.2px;
    margin: 0 0 6px 0;
    line-height: 1.2;
    transition: color 0.25s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bvb-club-venue-tag {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    max-width: 100%;
}

.bvb-club-venue-tag span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

/* Action Button - 3D Metallic Relief & Illuminated Edge Finish */
.bvb-club-action-btn {
    width: 100%;
    padding: 9px 14px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.16), 0 4px 10px rgba(0, 0, 0, 0.4), 0 0 10px var(--club-alpha, rgba(56, 189, 248, 0.12));
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    z-index: 2;
}

.bvb-club-action-btn i {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.5));
}

/* Metrics Bar (PTS, PJ, DIF) */
.bvb-club-metrics-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 6px 4px;
    margin: 4px 0 12px 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 2;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.bvb-metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.bvb-metric-num {
    color: #ffffff;
    font-weight: 900;
    font-size: 1.02rem;
    line-height: 1.1;
    letter-spacing: -0.3px;
    font-family: 'Outfit', sans-serif;
}

/* Colores Condicionales Suaves en DIF */
.bvb-metric-num.bvb-dif-pos {
    color: #4ade80 !important; /* Verde suave positivo */
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.bvb-metric-num.bvb-dif-neg {
    color: #f87171 !important; /* Rojo tenue negativo */
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.bvb-metric-num.bvb-dif-zero {
    color: #94a3b8 !important; /* Neutro suave */
}

.bvb-metric-lbl {
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.bvb-metric-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
}

/* DYNAMIC HOVER & CLICK STATE IN TEAM'S OWN COLOR */
.bvb-club-card-link:hover .bvb-club-card,
.bvb-club-card-link:active .bvb-club-card,
.bvb-club-card.active {
    transform: translateY(-6px);
    border-color: var(--club-primary, #dc052d);
    background: linear-gradient(180deg, var(--club-alpha, rgba(220,5,45,0.14)) 0%, #10121a 80%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 20px var(--club-glow, rgba(220,5,45,0.3));
}

.bvb-club-card-link:hover .bvb-club-card-stripe {
    height: 5px;
}

.bvb-club-card-link:hover .bvb-club-card-top-glow,
.bvb-club-card-link:active .bvb-club-card-top-glow {
    opacity: 1;
    height: 135px;
}

.bvb-club-card-link:hover .bvb-club-metrics-bar,
.bvb-club-card-link:active .bvb-club-metrics-bar {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(255, 255, 255, 0.16);
}

.bvb-club-card-link:hover .bvb-club-crest-wrap,
.bvb-club-card-link:active .bvb-club-crest-wrap {
    transform: scale(1.08);
    border-color: var(--club-primary, #dc052d);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px var(--club-glow, rgba(220,5,45,0.35));
}

.bvb-club-card-link:hover .bvb-club-crest-img,
.bvb-club-card-link:active .bvb-club-crest-img {
    transform: scale(1.1);
}

.bvb-club-card-link:hover .bvb-club-name,
.bvb-club-card-link:active .bvb-club-name {
    color: #ffffff;
}

.bvb-club-card-link:hover .bvb-club-action-btn,
.bvb-club-card-link:active .bvb-club-action-btn {
    background: linear-gradient(180deg, var(--club-primary, #0284c7) 0%, #0369a1 100%) !important;
    color: var(--club-text, #ffffff) !important;
    border-color: var(--club-primary, #38bdf8) !important;
    border-top-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35), 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 16px var(--club-glow, rgba(56, 189, 248, 0.4));
    transform: translateY(-1px);
}

.bvb-club-card-link:hover .bvb-club-action-btn i,
.bvb-club-card-link:active .bvb-club-action-btn i {
    transform: translateX(4px);
}

.bvb-club-card-link {
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
}

.bvb-club-card-link:active .bvb-club-card {
    transform: scale(0.97) translateY(0) !important;
    transition: transform 0.12s ease-out !important;
}

/* RESPONSIVE MOBILE ADJUSTMENTS */
@media (max-width: 640px) {
    .bvb-directory-page {
        padding: 16px 0 calc(115px + env(safe-area-inset-bottom, 20px)) 0 !important;
    }
    .bvb-dir-header {
        padding: 20px 16px !important;
        margin-bottom: 20px !important;
        border-radius: 16px !important;
        gap: 14px !important;
    }
    .bvb-dir-title-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.25rem !important;
        border-radius: 12px !important;
    }
    .bvb-dir-title {
        font-size: 1.35rem !important;
    }
    .bvb-dir-search-wrap {
        width: 100% !important;
    }
    .bvb-meta-torneo {
        font-size: 0.82rem !important;
    }
    .bvb-meta-cat {
        font-size: 10.5px !important;
        padding: 2px 7px !important;
    }
    .bvb-meta-count {
        font-size: 0.78rem !important;
    }
    .bvb-clubs-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 12px !important;
    }
    .bvb-club-card-body {
        padding: 14px 8px 12px 8px !important;
    }
    .bvb-club-crest-wrap {
        width: 58px !important;
        height: 58px !important;
        margin-bottom: 6px !important;
        padding: 6px !important;
    }
    .bvb-club-crest-img {
        max-width: 40px !important;
        max-height: 40px !important;
    }
    .bvb-club-name {
        font-size: 0.92rem !important;
        margin-bottom: 4px !important;
    }
    .bvb-club-venue-tag {
        font-size: 0.72rem !important;
        padding: 3px 9px !important;
        margin-bottom: 10px !important; /* Respiro limpio antes de puntos/partidos */
    }
    .bvb-club-venue-tag span {
        max-width: 120px !important;
    }
    .bvb-club-metrics-bar {
        padding: 5px 3px !important;
        margin: 2px 0 12px 0 !important; /* Espaciado armónico */
        border-radius: 8px !important;
    }
    .bvb-metric-num {
        font-size: 0.88rem !important;
    }
    .bvb-metric-lbl {
        font-size: 0.58rem !important;
    }
    .bvb-metric-divider {
        height: 16px !important;
    }
    .bvb-club-action-btn {
        padding: 7px 8px !important;
        font-size: 0.68rem !important;
        border-radius: 8px !important;
    }
    .bvb-club-action-btn:active {
        transform: scale(0.96) !important;
    }
}
