/* ============================================
   STYLES GLOBAUX
   ============================================ */

@page {
    size: A4;
    margin: 2mm;
}

body {
    font-family: 'Roboto Condensed', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #e2e8f0;
}

/* ============================================
   CONTENEURS PRINCIPAUX
   ============================================ */

.page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 9px;
}

.page-container {
    width: 100%;
    background-color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
    padding: 2mm;
    padding-top: 2mm;
    min-height: 297mm;
}

#storageArea {
    max-width: 1100px;
    margin: 0 auto;
}

/* ============================================
   FORMULAIRE D'EN-TÊTE
   ============================================ */

.header-container {
    border-color: #fe9a39;
    border-width: 5px;
    max-width: 600px;
}

.header-input {
    border: none;
    border-bottom: 1px dashed #999;
    border-radius: 0;
    padding: 2px 4px;
    width: 100%;
    outline: none;
    transition: border-color 0.1s;
}

.header-input:focus {
    border-bottom-color: #1d4ed8;
}

/* ============================================
   TABLEAU
   ============================================ */

#scheduleTable {
    border-collapse: collapse;
    border: none;
    font-size: 0.800rem;
}

#scheduleTable th,
#scheduleTable td {
    border: none !important;
    padding: 0px 2px;
    height: 15px;
    line-height: 15px;
}

.schedule-row {
    border-bottom: 1px solid #e5e7eb;
    cursor: grab;
}

.schedule-row:active {
    cursor: grabbing;
}

.opacity-40 {
    opacity: 0.4;
}

.drag-highlight {
    box-shadow: 0 0 0 2px #3b82f6 inset;
    background-color: #eff6ff !important;
    transition: none;
}

/* ============================================
   STYLES DES EN-TÊTES DE COLONNE
   ============================================ */

.bg-table-header-orange {
    background-color: #ff6600;
    color: black;
}

.session-highlight-orange {
    background-color: #fed5b7;
    color: #1f2937;
    font-weight: 700;
}

.time-cell {
    font-weight: 700;
    color: #1e40af;
    background-color: #eff6ff;
}

/* ============================================
   SÉLECTS ET INPUTS DU TABLEAU
   ============================================ */

.duration-select,
.laps-input,
.pause-input,
.datalist-input {
    font-size: 0.875rem;
    padding: 0px 4px;
}

/* ============================================
   IMPRESSION (PDF)
   ============================================ */

@media print {
    body {
        background: none;
    }

    .page-wrapper {
        padding: 0;
    }

    .page-container {
        margin: 0;
        box-shadow: none;
        padding: 2mm;
        padding-top: 2mm;
        width: 210mm;
        min-height: 297mm;
    }

    .no-print {
        display: none !important;
    }

    .print-hidden-col {
        display: none !important;
    }

    .header-container {
        border-width: 2px !important;
        border-style: solid !important;
        border-color: #fe9a39 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        max-width: 160mm !important;
        margin: 0 auto 5mm auto !important;
    }

    .header-container hr {
        margin: 0.5mm 0 !important;
    }

    input,
    select,
    textarea {
        border: none !important;
        box-shadow: none !important;
        background-color: transparent !important;
        -webkit-print-color-adjust: exact;
        color: #000;
    }

    select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        padding-right: 0 !important;
        background-image: none !important;
    }

    select option[value=""] {
        display: none;
    }

    .session-cell,
    .championship-cell,
    .category-cell,
    .group-cell,
    .laps-cell,
    .duration-cell {
        text-align: left !important;
    }

    .session-highlight-orange,
    .time-cell,
    .bg-table-header-orange {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .session-highlight-orange input,
    .session-highlight-orange select {
        background-color: transparent !important;
    }

    .schedule-row {
        border-bottom: 1px solid #ccc;
        cursor: default !important;
    }

    .header-input {
        border-bottom: none !important;
    }
}