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

:root {
    --bg-body: #f4f6f9;
    --border-color: #e2e8f0;
    --primary-blue: #0066ff;
    --primary-blue-dark: #0052cc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER */
.main-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-zone {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.brand-logo-img {
    display: block;
    height: 44px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.brand-divider {
    width: 1px;
    height: 28px;
    background-color: var(--border-color);
}

.brand-sub {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-sub strong {
    font-size: 0.85rem;
    color: var(--primary-blue);
    font-weight: 800;
}

.brand-sub span {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-left: auto;
}

.player-search-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.player-search-input {
    width: 16rem;
    border: 1px solid #d0dce8;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    color: var(--text-main);
    background: #ffffff;
    font-size: 0.84rem;
}

.player-search-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.player-search-submit {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--primary-blue);
    border-radius: 999px;
    padding: 0.42rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.player-search-submit:hover {
    background: #f8fafc;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.btn-hub {
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.hub-menu-wrapper {
    position: relative;
    z-index: 1002;
}

.team-hub-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    border: none;
    margin: 0;
    padding: 0;
    z-index: 1000;
}

.team-hub-panel {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    width: min(720px, calc(100vw - 2rem));
    max-height: 72vh;
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    padding: 0.9rem;
    display: none;
}

.team-hub-panel.open {
    display: block;
}

.team-hub-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.45rem;
}

.team-hub-header strong {
    color: var(--text-main);
    font-size: 0.85rem;
}

.team-hub-header span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.team-hub-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.team-hub-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.team-hub-link:hover {
    border-color: #bfdbfe;
    background: #f0f7ff;
}

.team-hub-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #dbeafe;
    padding: 1px;
    box-sizing: border-box;
}

.team-code {
    font-weight: 800;
    color: var(--primary-blue);
    font-size: 0.72rem;
    min-width: 2rem;
}

.team-name {
    font-size: 0.76rem;
    font-weight: 600;
}

/* NAV BAR */
.nav-bar {
    background: #ffffff;
    border-bottom: 2px solid var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    padding: 0.85rem 0;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.nav-link.active, .nav-link:hover {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

/* MAIN CONTENT LAYOUT */
.main-content {
    max-width: 1280px;
    width: 100%;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
}

/* HERO BANNER */
.hero-banner {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 320px;
    margin-bottom: 1.5rem;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(2, 11, 24, 0.9) 100%);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    color: #ffffff;
}

.tag-blue {
    background-color: var(--primary-blue);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.hero-overlay h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0.5rem 0;
    line-height: 1.25;
}

.hero-overlay p {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin: 0;
}

/* SUB NEWS GRID */
.sub-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.news-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
}

.sub-tag {
    color: var(--primary-blue);
    font-weight: 800;
    font-size: 0.65rem;
    text-transform: uppercase;
}

.news-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0.4rem 0;
}

.news-card p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.news-card-link {
    display: inline-block;
    margin-top: 0.7rem;
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
}

.news-card-link:hover {
    text-decoration: underline;
}

/* QUICK TEAMS */
.quick-teams-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.badge-count {
    color: var(--primary-blue);
    font-size: 0.7rem;
    font-weight: 800;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.team-chip {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.8rem;
}

.team-chip.active {
    border-color: var(--primary-blue);
    background: #f0f7ff;
}

.section-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0;
}

/* SIDEBAR */
.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 0.8rem;
    font-weight: 800;
    margin: 0;
}

.link-more {
    color: var(--primary-blue);
    font-size: 0.7rem;
    font-weight: 800;
    text-decoration: none;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.standings-table th {
    color: var(--text-muted);
    text-align: left;
    padding-bottom: 0.5rem;
    font-weight: 600;
}

.standings-table td {
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

.standings-table tr.highlight td {
    color: var(--primary-blue);
}

.text-center { text-align: center; }
.font-bold { font-weight: 700; }

.presidency-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 1rem;
}

.presidency-box p {
    font-size: 0.8rem;
    color: #1e40af;
    margin: 0 0 0.8rem 0;
}

.btn-outline-blue {
    display: block;
    text-align: center;
    border: 1px solid var(--primary-blue);
    background: #fff;
    color: var(--primary-blue);
    padding: 0.4rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
}

/* FOOTER */
.main-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 0 1.5rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 2rem;
}

.footer-col.brand-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.footer-col h3 { font-size: 1rem; font-weight: 800; color: var(--primary-blue); margin-top: 0; }
.footer-col h4 { font-size: 0.75rem; font-weight: 800; color: var(--text-main); margin-top: 0; }

.footer-col p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { color: var(--text-muted); text-decoration: none; font-size: 0.75rem; }

.copyright { display: block; margin-top: 1rem; font-size: 0.7rem; color: var(--text-muted); }

.dg-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 6px;
}

.dg-card h5 { margin: 0 0 0.4rem 0; font-size: 0.75rem; font-weight: 800; color: var(--primary-blue); }
.dg-card p { margin-bottom: 0.8rem; }

.btn-dg {
    display: block;
    background: var(--primary-blue);
    color: #fff;
    text-align: center;
    padding: 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.7rem;
}

#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.35);
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.reconnect-card {
    width: min(520px, 100%);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
    padding: 1rem 1.1rem;
}

.reconnect-card h2 {
    margin: 0 0 0.55rem 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.reconnect-text {
    display: none;
    margin: 0;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.4;
}

#components-reconnect-modal.components-reconnect-show .reconnect-showing,
#components-reconnect-modal.components-reconnect-failed .reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-rejected {
    display: block;
}

.reconnect-reload-button {
    display: none;
    margin-top: 0.9rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--primary-blue);
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-reload-button,
#components-reconnect-modal.components-reconnect-rejected .reconnect-reload-button {
    display: inline-block;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVE DESIGN)
   ========================================================================== */

/* Écrans moyens et tablettes (Masse la sidebar sous le contenu principal) */
@media (max-width: 992px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .sub-news-grid {
        grid-template-columns: 1fr 1fr;
    }

    .teams-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
    }

    .team-hub-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Smartphones et petits écrans */
@media (max-width: 640px) {
    .brand-logo-img {
        height: 36px;
        max-width: 130px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .player-search-form {
        width: 100%;
    }

    .player-search-input {
        width: 100%;
    }

    .team-hub-logo {
        width: 22px;
        height: 22px;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .btn-hub {
        width: 100%;
        text-align: center;
    }

    .hub-menu-wrapper {
        width: 100%;
    }

    .team-hub-panel {
        right: auto;
        left: 0;
        width: 100%;
        max-height: 65vh;
    }

    .team-hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-container {
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .nav-container::-webkit-scrollbar {
        display: none;
    }

    .hero-banner {
        height: 240px;
    }

    .hero-overlay h1 {
        font-size: 1.25rem;
    }

    .hero-overlay p {
        display: none; /* Cache la description longue sur mobile pour alléger */
    }

    .sub-news-grid {
        grid-template-columns: 1fr;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}