/* ========================================
   Amateur Pages - Planning Table
   ======================================== */

/* Planning Section */
.planning-section {
    margin-bottom: 3rem;
}

.planning-wrapper {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.planning-header {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    background: #ffffff;
}

.planning-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.planning-header p {
    font-size: 0.95rem;
    color: #c0392b;
    font-weight: 600;
    font-style: italic;
}

/* Filter Bar */
.planning-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1.25rem 1rem;
    justify-content: center;
}


/* Row hide/show animation */
.planning-full tbody tr {
    transition: opacity 0.2s ease;
}

.planning-full tbody tr.hidden-row {
    display: none;
}

/* Scrollable container */
.planning-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Main Table */
.planning-full {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.planning-full thead th {
    background: #d9d9d9;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.5rem 0.6rem;
    text-align: center;
    border: 1px solid #bfbfbf;
    white-space: nowrap;
}

.planning-full tbody td {
    padding: 0.4rem 0.5rem;
    border: 1px solid #d0d0d0;
    text-align: center;
    vertical-align: middle;
    color: #1a1a1a;
    line-height: 1.4;
}

/* First 4 columns: info columns */
.planning-full tbody td:nth-child(1) {
    font-weight: 700;
    white-space: nowrap;
    background: #f9f9f9;
}

.planning-full tbody td:nth-child(2) {
    white-space: nowrap;
    background: #f9f9f9;
}

.planning-full tbody td:nth-child(3) {
    white-space: nowrap;
    font-size: 0.75rem;
    background: #f9f9f9;
}

.planning-full tbody td:nth-child(4) {
    white-space: nowrap;
    background: #f9f9f9;
}

/* Alternating row subtle background */
.planning-full tbody tr:nth-child(even) td:nth-child(-n+4) {
    background: #f2f2f2;
}

/* Gym color classes */
.gym-palmeira {
    background-color: #f4cccc !important;
}

.gym-estienne {
    background-color: #cfe2f3 !important;
}

.gym-trotabas {
    background-color: #d9ead3 !important;
}

/* Multi-line cell content */
.planning-full .cell-multi {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.planning-full .cell-multi span {
    display: block;
}

/* Footer row with gym addresses */
.planning-full tfoot td {
    padding: 0.5rem 0.6rem;
    font-weight: 700;
    font-size: 0.7rem;
    color: #ffffff;
    text-align: center;
    border: 1px solid #bfbfbf;
}

.gym-footer-palmeira {
    background-color: #c0504d !important;
}

.gym-footer-estienne {
    background-color: #4472c4 !important;
}

.gym-footer-trotabas {
    background-color: #548235 !important;
}

/* Footnote text */
.planning-footnote {
    font-size: 0.7rem;
    color: #666;
    font-style: italic;
}

/* Info box override for light section */
.planning-section .info-box {
    background: rgba(220, 175, 77, 0.1);
    border: 1px solid rgba(220, 175, 77, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.planning-section .info-box h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.planning-section .info-box p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ========================================
   Mobile Planning - Card Layout
   ======================================== */
@media (max-width: 768px) {
    .planning-header h2 {
        font-size: 1.3rem;
    }

    .planning-scroll {
        overflow-x: visible;
    }

    .planning-full {
        min-width: 0;
        display: block;
    }

    .planning-full thead {
        display: none;
    }

    .planning-full tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .planning-full tbody tr {
        display: block;
        background: #fff;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border-left: 4px solid var(--primary);
    }

    .planning-full tbody tr.hidden-row {
        display: none;
    }

    .planning-full tbody td {
        display: block;
        border: none;
        text-align: left;
        padding: 0;
        background: transparent !important;
        line-height: 1.5;
    }

    /* Hide empty cells */
    .planning-full tbody td:empty {
        display: none;
    }

    /* Category */
    .planning-full tbody td:nth-child(1) {
        font-weight: 800;
        font-size: 1.05rem;
        color: var(--primary);
        background: transparent !important;
    }

    /* Team name */
    .planning-full tbody td:nth-child(2) {
        font-weight: 600;
        font-size: 0.95rem;
        color: #333;
        margin-bottom: 0.25rem;
        background: transparent !important;
    }

    /* Birth year */
    .planning-full tbody td:nth-child(3) {
        font-size: 0.8rem;
        color: #888;
        background: transparent !important;
    }
    .planning-full tbody td:nth-child(3):not(:empty)::before {
        content: "Naissance : ";
        font-weight: 600;
        color: #666;
    }

    /* Coach */
    .planning-full tbody td:nth-child(4) {
        font-size: 0.8rem;
        color: #888;
        padding-bottom: 0.6rem;
        margin-bottom: 0.6rem;
        border-bottom: 1px solid #eee;
        background: transparent !important;
    }
    .planning-full tbody td:nth-child(4):not(:empty)::before {
        content: "Coach : ";
        font-weight: 600;
        color: #666;
    }

    /* Day columns - training schedule chips */
    .planning-full tbody td:nth-child(n+5) {
        padding: 0.5rem 0.75rem;
        margin-top: 0.35rem;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 500;
        color: #1a1a1a;
    }

    .planning-full tbody td:nth-child(n+5)::before {
        font-weight: 700;
        margin-right: 0.5rem;
    }

    .planning-full tbody td:nth-child(5):not(:empty)::before { content: "Lun"; }
    .planning-full tbody td:nth-child(6):not(:empty)::before { content: "Mar"; }
    .planning-full tbody td:nth-child(7):not(:empty)::before { content: "Mer"; }
    .planning-full tbody td:nth-child(8):not(:empty)::before { content: "Jeu"; }
    .planning-full tbody td:nth-child(9):not(:empty)::before { content: "Ven"; }
    .planning-full tbody td:nth-child(10):not(:empty)::before { content: "Sam"; }

    /* Gym colors preserved on mobile */
    .planning-full tbody td.gym-palmeira {
        background-color: #f4cccc !important;
    }
    .planning-full tbody td.gym-estienne {
        background-color: #cfe2f3 !important;
    }
    .planning-full tbody td.gym-trotabas {
        background-color: #d9ead3 !important;
    }

    /* Cells without gym class get a neutral background */
    .planning-full tbody td:nth-child(n+5):not(:empty):not(.gym-palmeira):not(.gym-estienne):not(.gym-trotabas) {
        background-color: #f5f5f5 !important;
    }

    /* Multi-line cells */
    .planning-full .cell-multi {
        gap: 0.25rem;
    }

    /* Footer as gym legend */
    .planning-full tfoot {
        display: block;
        padding: 0.75rem;
    }

    .planning-full tfoot tr {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .planning-full tfoot td {
        display: block;
        border-radius: 8px;
        font-size: 0.75rem;
        border: none;
        padding: 0.6rem 0.75rem;
        text-align: left;
    }

    /* Footnote */
    .planning-footnote {
        display: block;
        margin-top: 0.25rem;
    }

    /* Filters - better touch targets */
    .planning-filters .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        min-height: 44px;
    }
}
