/* Variables HorizonDuo Corporate */
:root {
    --horizon-blue: #1e40af;
    --horizon-light: #3b82f6;
    --duo-accent: #059669;
    --duo-light: #10b981;
    --neutral-dark: #1f2937;
    --neutral-medium: #6b7280;
    --neutral-light: #f3f4f6;
    --white: #ffffff;
    --success: #059669;
    --warning: #f59e0b;
    --error: #dc2626;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--neutral-dark);
    background: linear-gradient(135deg, var(--horizon-blue) 0%, var(--horizon-light) 100%);
    min-height: 100vh;
}

/* Layout principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Page d'accueil - Branding HorizonDuo */
.hero {
    text-align: center;
    padding: 40px 0 60px;
}

.logo-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.horizon {
    color: var(--horizon-blue);
}

.duo {
    color: var(--duo-accent);
}

.subtitle {
    display: block;
    font-size: 1.5rem;
    color: var(--neutral-medium);
    font-weight: 600;
    margin-top: 8px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--neutral-medium);
    margin-top: 10px;
}

/* Cartes d'accès */
.access-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.access-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.access-card:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.access-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--neutral-dark);
}

.access-card p {
    color: var(--neutral-medium);
    margin-bottom: 25px;
}

.code-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.code-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
    transition: border-color 0.3s ease;
}

.code-input input:focus {
    outline: none;
    border-color: var(--horizon-blue);
}

/* Boutons */
.btn-primary, .btn-secondary, .btn-logout {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--horizon-blue), var(--horizon-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--duo-accent), var(--duo-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-logout {
    background: var(--error);
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: #b91c1c;
}

/* Interface Formateur */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.page-header h2 {
    color: var(--neutral-dark);
    font-size: 1.8rem;
}

.formateur-dashboard {
    display: grid;
    gap: 30px;
}

.quiz-selection {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.quiz-selection h3 {
    margin-bottom: 15px;
    color: var(--neutral-dark);
}

.quiz-selection select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: white;
}

.session-control {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.session-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid #e5e7eb;
}

.session-code {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--horizon-blue);
}

.participants-count {
    font-size: 1.1rem;
    color: var(--duo-accent);
}

.question-control h4 {
    color: var(--neutral-dark);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.question-control p {
    color: var(--neutral-medium);
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
}

.question-options {
    display: grid;
    gap: 10px;
    margin-bottom: 25px;
}

.option-display {
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--horizon-blue);
}

.correct-answer {
    padding: 12px 16px;
    background: rgba(5, 150, 105, 0.1);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--success);
    color: var(--success);
    font-weight: 600;
    margin-top: 10px;
}

.question-navigation {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Graphiques des résultats */
.results-display {
    margin-top: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
}

.results-display h4 {
    color: var(--neutral-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.chart-bar-container {
    margin-bottom: 15px;
}

.chart-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-weight: 600;
}

.option-text {
    flex: 1;
    color: var(--neutral-dark);
}

.response-count {
    color: var(--horizon-blue);
    font-weight: 700;
}

.chart-bar {
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.chart-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--horizon-blue), var(--duo-accent));
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Interface Étudiant */
.etudiant-interface {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    min-height: 500px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* Écran de saisie du nom */
.name-input-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
    padding: 40px;
}

.name-input-content h3 {
    color: var(--neutral-dark);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.name-input-content p {
    color: var(--neutral-medium);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.name-input-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.name-input-form input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    text-align: center;
    min-width: 250px;
    transition: border-color 0.3s ease;
}

.name-input-form input:focus {
    outline: none;
    border-color: var(--horizon-blue);
}

.waiting-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
    padding: 40px;
}

.waiting-content h3 {
    color: var(--neutral-dark);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.waiting-content p {
    color: var(--neutral-medium);
    font-size: 1.1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--horizon-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.question-screen {
    padding: 30px;
}

.progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--horizon-blue), var(--duo-accent));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 0.9rem;
    color: var(--neutral-medium);
    font-weight: 600;
}

.question-content h3 {
    color: var(--neutral-dark);
    margin-bottom: 15px;
    font-size: 1.4rem;
    transition: opacity 0.3s ease;
}

.question-content p {
    color: var(--neutral-medium);
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.7;
    transition: opacity 0.3s ease;
}

.answer-options {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.answer-btn {
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    background: white;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-btn:hover {
    border-color: var(--horizon-blue);
    background: #f8fafc;
}

.answer-btn.selected {
    border-color: var(--horizon-blue);
    background: rgba(30, 64, 175, 0.1);
    color: var(--horizon-blue);
    font-weight: 600;
}

.option-letter {
    display: inline-block;
    width: 25px;
    height: 25px;
    background: var(--horizon-blue);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.answer-btn.selected .option-letter {
    background: white;
    color: var(--horizon-blue);
}

.response-feedback {
    text-align: center;
    padding: 15px;
    background: rgba(5, 150, 105, 0.1);
    border-radius: var(--border-radius);
    color: var(--success);
    font-weight: 600;
}

.final-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
    padding: 40px;
}

.final-content h3 {
    color: var(--neutral-dark);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.final-content p {
    color: var(--neutral-medium);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

/* Classement final */
.final-ranking {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
}

.ranking-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--neutral-dark);
    margin-bottom: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 5px 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.ranking-position {
    font-size: 1.2rem;
}

.ranking-name {
    font-weight: 600;
    color: var(--neutral-dark);
}

/* Indicateur de synchronisation */
.sync-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sync-status.synced {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
    border: 1px solid #059669;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.sync-status.syncing {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid #f59e0b;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    color: white;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .main-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .access-cards {
        grid-template-columns: 1fr;
    }

    .code-input {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .question-navigation {
        flex-direction: column;
    }

    .sync-status {
        top: 10px;
        right: 10px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .name-input-form input {
        min-width: 200px;
    }

    .chart-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: fadeIn 0.5s ease-out;
}
/* Indicateurs de type de question */
.type-indicator {
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: center;
}

.type-indicator.quiz-mode {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(59, 130, 246, 0.1));
    color: var(--horizon-blue);
    border: 2px solid var(--horizon-blue);
}

.type-indicator.poll-mode {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), rgba(16, 185, 129, 0.1));
    color: var(--duo-accent);
    border: 2px solid var(--duo-accent);
}

/* Styles pour les sondages côté étudiant */
.poll-indicator, .quiz-indicator {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.poll-indicator {
    background: var(--duo-accent);
    color: white;
}

.quiz-indicator {
    background: var(--horizon-blue);
    color: white;
}

/* Boutons de réponse pour sondages */
.answer-btn.poll-style {
    border-color: var(--duo-accent);
    background: rgba(5, 150, 105, 0.05);
}

.answer-btn.poll-style:hover {
    border-color: var(--duo-accent);
    background: rgba(5, 150, 105, 0.1);
}

.answer-btn.poll-style.selected {
    border-color: var(--duo-accent);
    background: rgba(5, 150, 105, 0.2);
    color: var(--duo-accent);
}

.answer-btn.poll-style .option-letter {
    background: var(--duo-accent);
}
.question-timer-container, .student-timer-container {
    text-align: center;
    margin: 15px 0;
}

.timer-normal {
    background: var(--horizon-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.timer-warning {
    background: var(--warning);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    animation: pulse 1s infinite;
}

.timer-urgent {
    background: var(--error);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    animation: pulse 0.5s infinite;
}
