/* Reset et base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #000000;
    --color-primary-hover: #333333;
    --color-success: #74EC8D;
    --color-warning: #EBB016;
    --color-danger: #FF1A6A;
    --color-info: #21DAFF;
    --color-text: #1a1a1a;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-background: #f5f5f7;
    --color-white: #ffffff;
    --color-border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Gradient Header */
.gradient-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background: linear-gradient(to right, #21DAFF 0%, #74EC8D 20%, #E0FF20 40%, #EBB016 60%, #FF5C1A 80%, #FF1A6A 100%);
    z-index: 100;
}

/* Header */
.header {
    background: var(--color-white);
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
    margin-top: 18px;
    position: sticky;
    top: 18px;
    z-index: 50;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-content {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.logo-separator {
    margin: 0 8px;
    color: var(--color-text-muted);
    font-weight: 300;
}

.logo-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text-light);
}

.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.9rem;
    color: var(--color-text);
    font-weight: 500;
}

/* Container */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Content */
.main-content {
    padding: 32px 0 60px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* Error State */
.error-state {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    max-width: 440px;
    margin: 60px auto;
}

.error-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.error-state h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-danger);
}

.error-state p {
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.error-hint {
    font-size: 0.85rem;
    margin-top: 16px;
}

/* Logged Out State */
.logged-out-state {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    max-width: 440px;
    margin: 60px auto;
}

.logged-out-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.logged-out-state h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.logged-out-state p {
    color: var(--color-text-light);
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Day Section */
.day-section {
    margin-bottom: 40px;
}

.day-section:last-child {
    margin-bottom: 0;
}

.day-header {
    margin-bottom: 16px;
}

.day-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    text-transform: capitalize;
}

.day-sessions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Sessions List */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Session Card - Design épuré */
.session-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.session-card:hover {
    box-shadow: var(--shadow-md);
}

/* Session Header simplifié */
.session-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.session-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.session-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Role Badge */
.role-badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.moderateur {
    background: linear-gradient(135deg, #FF5C1A, #FF1A6A);
    color: var(--color-white);
}

.role-badge.intervenant {
    background: linear-gradient(135deg, #21DAFF, #74EC8D);
    color: var(--color-text);
}

/* Presentation Section */
.presentation-section {
    padding: 20px 24px;
}

.presentation-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.presentation-title::before {
    content: "";
    width: 4px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* Files Area */
.files-area {
    background: var(--color-background);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.files-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
}

/* Bouton d'upload */
.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-upload:hover {
    background: var(--color-primary-hover);
}

.btn-upload svg {
    width: 14px;
    height: 14px;
}

/* Files List */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    gap: 12px;
}

.file-item-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.file-item-nok {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    padding: 4px;
    margin: -4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.file-link:hover {
    background: var(--color-background);
}

.file-link:hover .file-name {
    color: var(--color-primary);
}

.file-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #21DAFF 0%, #74EC8D 25%, #E0FF20 50%, #EBB016 75%, #FF5C1A 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: black;
}

.file-details {
    min-width: 0;
}

.file-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
}

.file-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 500;
}

.file-status-ok {
    color: #16a34a;
}

.file-status-nok {
    color: #dc2626;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.file-status-ok .status-dot {
    background: #22c55e;
}

.file-status-nok .status-dot {
    background: #ef4444;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.file-meta span::after {
    content: "·";
    margin-left: 8px;
}

.file-meta span:last-child::after {
    content: none;
}

.no-files {
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Bouton de suppression */
.btn-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-delete:hover {
    background: #fee2e2;
    color: var(--color-danger);
}

.btn-delete svg {
    width: 16px;
    height: 16px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Modal de confirmation */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.modal-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.modal-warning {
    color: var(--color-danger) !important;
    font-size: 0.8rem !important;
    margin-top: 8px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--color-background);
    color: var(--color-text);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-danger {
    padding: 10px 20px;
    background: var(--color-danger);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #e6175f;
}

/* Bouton déconnexion */
.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--color-background);
    color: var(--color-text-light);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #fee2e2;
    color: var(--color-danger);
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 1.3rem;
    }

    .logo-subtitle {
        font-size: 1.3rem;
    }

    .btn-logout span {
        display: none;
    }
}

@media (max-width: 640px) {
    .header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-separator,
    .logo-subtitle {
        display: none;
    }

    .user-area {
        width: 100%;
        justify-content: space-between;
    }

    .user-name {
        font-size: 0.85rem;
    }

    .btn-logout span {
        display: inline;
    }

    .day-nav {
        gap: 6px;
    }

    .day-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .session-header {
        padding: 16px;
    }

    .session-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .presentation-section {
        padding: 16px;
    }

    .files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-upload {
        width: 100%;
        justify-content: center;
    }

    .file-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-icon {
        display: none;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* Animation d'entrée */
.sessions-container {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.session-card {
    animation: fadeInUp 0.4s ease-out both;
}

.session-card:nth-child(1) { animation-delay: 0.05s; }
.session-card:nth-child(2) { animation-delay: 0.1s; }
.session-card:nth-child(3) { animation-delay: 0.15s; }
.session-card:nth-child(4) { animation-delay: 0.2s; }
.session-card:nth-child(5) { animation-delay: 0.25s; }

/* Input file caché */
.file-input-hidden {
    display: none;
}

/* Bouton upload en cours */
.btn-upload.uploading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Barre de progression upload */
.upload-progress {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.upload-progress.hidden {
    display: none;
}

.upload-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.upload-filename {
    color: var(--color-text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 50px);
}

.upload-percent {
    color: var(--color-text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.upload-progress-bar {
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #21DAFF, #74EC8D);
    border-radius: 3px;
    transition: width 0.2s ease;
}

.upload-progress-fill.success {
    background: #22c55e;
    width: 100% !important;
}

.upload-progress-fill.error {
    background: #ef4444;
}

/* Détails de progression (taille + temps restant) */
.upload-progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.upload-size {
    font-variant-numeric: tabular-nums;
}

.upload-eta {
    font-style: italic;
}

/* Toast de succès */
.upload-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #22c55e;
    color: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1001;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-toast.fade-out {
    animation: toastFadeOut 0.3s ease-out forwards;
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Responsive toast et upload */
@media (max-width: 640px) {
    .upload-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .upload-progress {
        padding: 10px 12px;
    }
    
    .upload-filename {
        font-size: 0.8rem;
        max-width: calc(100% - 45px);
    }
}