/* ===== VARIABLES GLOBALES ===== */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --background-color: #f9f9f9;
    --text-color: #333;
    --light-text-color: #666;
    --border-color: #ddd;
    --button-bg: #4CAF50;
    --button-hover: #45a049;
    --remove-button-bg: #f44336;
    --remove-button-hover: #d32f2f;
    --menu-bg: #2c3e50;
    --menu-text: #ecf0f1;
}

/* ===== STYLES GLOBAUX ===== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--menu-bg) 0%, var(--primary-color) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 10px 10px;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1::before {
    content: "⚡";
    font-size: 28px;
}

.back-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.back-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.container {
    width: 90%;
    margin: 0 auto;
    padding: 20px;
}

/* ===== SECTIONS ===== */
.filter-section, /* RÉINTÉGRÉ */
.form-section,
.account-info,
.password-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.filter-section { /* Style spécifique pour la section de filtres */
    padding: 15px;
}

.password-form {
    margin-top: 20px;
}

/* ===== FORMULAIRES ===== */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.filter-group, .form-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    margin-top: 2px;
    gap: 1px;
}

.form-group {
    margin-bottom: 15px;
}

.filter-group label, .form-group label {
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
    min-width: 80px;
    align-items: center;
}

.filter-group select,
.filter-group input,
.form-group input,
.form-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

/* Grille pour formulaire compact */
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    row-gap: 4px;
    margin-bottom: 2px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

.span-2 {
    grid-column: span 2;
}

.full-width {
    grid-column: span 3;
}

.datetime-control {
    width: 160px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* ===== BOUTONS ===== */
.buttons-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

button {
    padding: 8px 15px;
    font-size: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

.btn-submit {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.btn-submit:hover {
    background-color: #2980b9;
}

button.remove {
    background: var(--remove-button-bg);
}

button.remove:hover {
    background: var(--remove-button-hover);
}

.btn-edit {
    background: #5bc0de;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
}

.btn-delete {
    background: #d9534f;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
}

.btn-add {
    background: #5cb85c;
    color: white;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
}

/* ===== SESSIONS ===== */
.session-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    overflow: hidden;
}

.session-header {
    background: var(--menu-bg);
    color: white;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-header h3 {
    margin: 0;
    font-size: 16px;
}

.session-header-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.session-details {
    padding: 15px;
    display: none;
}

.session-details.show {
    display: block;
}

.session-details p {
    margin: 8px 0;
    font-size: 14px;
}

/* ===== SÉQUENCES ===== */
.sequences-frame {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

.sequences-frame h2 {
    color: var(--error-color);
}

.sequences-frame th {
    color: var(--text-color);
}

#sequences-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

#sequences-table th,
#sequences-table td {
    padding: 2px;
    text-align: center;
    border: 1px solid var(--border-color);
}

#sequences-table th {
    background: #f8f9fa;
    font-weight: bold;
}

/* Largeurs spécifiques pour chaque colonne */
#sequences-table th:nth-child(1),
#sequences-table td:nth-child(1) { width: 140px; }
#sequences-table th:nth-child(2),
#sequences-table td:nth-child(2) { width: 140px; }
#sequences-table th:nth-child(3),
#sequences-table td:nth-child(3) { width: 100px; }
#sequences-table th:nth-child(4),
#sequences-table td:nth-child(4) { width: 100px; }
#sequences-table th:nth-child(5),
#sequences-table td:nth-child(5) { width: 90px; }
#sequences-table th:nth-child(6),
#sequences-table td:nth-child(6) { width: 90px; }
#sequences-table th:nth-child(7),
#sequences-table td:nth-child(7) { width: 100px; }

#sequences-table input[type="datetime-local"],
#sequences-table input[type="text"],
#sequences-table input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    padding: 4px;
    font-size: 13px;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

/* ===== TABLEAUX GÉNÉRIQUES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9em;
}

.sequence-table, table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.sequence-table th,
.sequence-table td,
th,
td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sequence-table th, th {
    background-color: var(--menu-bg);
    color: white;
    font-weight: 500;
}

.sequence-table tr:hover, tr:hover {
    background-color: #f5f5f5;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-sessions {
    padding: 20px;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== MESSAGES ===== */
.messages {
    margin-bottom: 20px;
}

.error {
    color: var(--error-color);
    background: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.success {
    color: var(--success-color);
    background: #d4edda;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
}

.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid #28a745;
    z-index: 1000;
    max-width: 400px;
    animation: fadeIn 0.3s;
}

.success-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
