/* CSS Reset & Variables */



.card-container, .card-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #ffffff;
    --card-bg: #eeeeee;
    --text-color: #242424;
    --text-muted: #555555;
    --primary-glow: #eaaf67;
    --primary-glow-rgb: #dddddd;
    --accent-color: #ff3333;
    --accent-glow-rgb: 255, 51, 51;
    --border-color: #dddddd;
    --font-mono: "Fira Code", "Courier New", Courier, monospace;
}

/* Scanline and Retro Terminal Effect */
.screen-card::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background:
        linear-gradient(
            rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%
        ),
        linear-gradient(
            90deg,
            rgba(255, 0, 0, 0.06),
            rgba(0, 255, 0, 0.02),
            rgba(0, 0, 255, 0.06)
        );
    z-index: 9999;
    background-size:
        100% 4px,
        6px 100%;
    pointer-events: none;
    opacity: 0.03;
    border-radius: 12px;
}

/* Header & Progress Bar */
header {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.logo-conspiracy {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--primary-glow);
    text-shadow: 0 0 8px rgba(var(--primary-glow-rgb), 0.4);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-conspiracy span {
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.2;
    }
}

.progress-container {
    width: 100%;
    max-width: 800px;
    height: 4px;
    background: #edf2f7;
    margin: 0 auto;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--primary-glow),
        #ff8800
    );
    box-shadow: 0 0 10px rgba(var(--primary-glow-rgb), 0.3);
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Main Container & Slide Transitions */
main {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 5;
}

.card-container {
    position: relative;
    width: 100%;
    max-width: 680px;
    height: 480px;
    perspective: 1000px;
    margin: 10px auto;
}

.screen-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    color: var(--text-color);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    // justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px) scale(0.97);
    transition:
        transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.screen-card.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.screen-card.exit-up {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-40px) scale(0.95);
}

.screen-card.enter-down {
    opacity: 0;
    pointer-events: none;
    transform: translateY(40px) scale(0.95);
}

/* Welcome Screen Elements */
.welcome-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.welcome-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(var(--primary-glow-rgb), 0.08);
    color: #622f0a;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(var(--primary-glow-rgb), 0.3);
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: #242424;
}

.welcome-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.6;
}

/* Generic Buttons & Inputs */
.btn-primary {
    background: var(--primary-glow);
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(var(--primary-glow-rgb), 0.3);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--primary-glow-rgb), 0.4);
    background: #f4c28c;
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Question Layout */
.question-label {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
    color: #242424;
}

.question-sublabel {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

/* Option Item */
.option-item {
    display: flex;
    align-items: center;
    background: #fcfcfc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    user-select: none;
}

.option-item:hover {
    background: #f1f5f9;
    border-color: var(--primary-glow);
}

.option-item.selected {
    background: #f0faf5;
    border-color: #68d391;
    box-shadow: 0 0 12px rgba(104, 211, 145, 0.15);
}

/* Shortcut Key Badge */
.key-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    min-width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.option-item:hover .key-badge {
    color: var(--primary-glow);
    border-color: var(--primary-glow);
}

.option-item.selected .key-badge {
    background: #38a169;
    color: #ffffff;
    border-color: #38a169;
}

.option-text {
    font-size: 1rem;
    line-height: 1.4;
    flex-grow: 1;
}

/* Multi-select Action Bar */
.action-bar {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.keyboard-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Scale Option (conspiracy eyes) */
.scale-list {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

.scale-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fcfcfc;
    border: 1px solid #e2e8f0;
    padding: 20px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scale-item:hover {
    background: #f1f5f9;
    border-color: var(--primary-glow);
}

.scale-item.selected {
    background: #f0faf5;
    border-color: #68d391;
    box-shadow: 0 0 12px rgba(104, 211, 145, 0.15);
}

.scale-key {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #718096;
    margin-top: 8px;
}

.scale-item.selected .scale-key {
    color: #622f0a;
}

.scale-icon {
    font-size: 1.6rem;
    transition: transform 0.2s ease;
}

.scale-item:hover .scale-icon {
    transform: scale(1.15);
}

/* Question Textarea */
.question-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2d3748;
    background: #ffffff;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.question-textarea:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 0 3px rgba(var(--primary-glow-rgb), 0.15);
}
.question-textarea::placeholder {
    color: #a0aec0;
}

/* Results & Stats screen */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 380px;
    padding-right: 8px;
}

.results-container::-webkit-scrollbar {
    width: 4px;
}
.results-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.result-question-block {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

.result-question-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.result-question-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-color);
}

.result-option {
    margin-bottom: 8px;
}

.result-option-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.result-option-label {
    color: var(--text-muted);
}

.result-option-stats {
    font-family: var(--font-mono);
    font-weight: bold;
    color: #622f0a;
}

.result-bar-bg {
    height: 6px;
    background: #edf2f7;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.result-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-glow);
    box-shadow: 0 0 8px rgba(var(--primary-glow-rgb), 0.2);
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.1, 1, 0.1, 1);
}

/* Error Screen */
.error-title {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: bold;
    font-family: var(--font-mono);
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(var(--accent-glow-rgb), 0.3);
}

/* Navigation Controls in Footer */
.nav-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
    z-index: 15;
}

.btn-nav {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-nav:hover {
    border-color: var(--primary-glow);
    color: var(--primary-glow);
    box-shadow: 0 0 10px rgba(var(--primary-glow-rgb), 0.1);
}

.btn-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-muted);
    box-shadow: none;
}

/* Loading Animation */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(var(--primary-glow-rgb), 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-glow);
    animation: spin 1s ease infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Survey Listing Compact (index.php) */
.survey-list {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    max-width: 80%;
}

.survey-item {
    display: flex;
    flex-direction: column;
    padding: 9px;
    margin-bottom: 6px;
    border: 3px solid var(--border-color);
    transition: background 0.15s ease;
    border-radius: 12px;
    background-color: var(--card-bg);
}

.survey-item:last-child { border-bottom: none; }

.survey-item:hover { background: rgba(var(--primary-glow-rgb), 0.03); }

.survey-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.survey-item-link:hover { color: inherit; }

.survey-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #242424;
    line-height: 1.4;
    margin: 0;
    max-width: 600px;
}

.survey-item-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #999;
    margin-top: 2px;
}

.survey-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3px;
    max-width: 600px;
}

/* Survey Detail View (sondage/index.php) */
.survey-detail {
    max-width: 680px;
    margin: 30px auto;
    padding: 35px 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-header {
    display: flex;
    gap: 8px;
    align-items: center;
}

.detail-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #242424;
    line-height: 1.2;
    margin: 0;
}

.detail-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #fcfcfc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #a0aec0;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.meta-value {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
}

.detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

/* Système de boutons uniformes (Pour LLM : .btn est la base, les modificateurs changent la couleur) */
.btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.4;
    background: #fff;
    color: #4a5568;
    border-color: #e2e8f0;
}
.btn:hover { filter: brightness(0.95); }

.btn-secondary {
    color: #4a5568;
    border-color: #e2e8f0;
}
.btn-secondary:hover { background: #f7fafc; }

.btn-primary {
    color: #fff;
    background: var(--primary-glow);
    border-color: var(--primary-glow);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-success {
    color: #22543d;
    border-color: #c6f6d5;
}
.btn-success:hover { background: #f0fff4; }

.btn-danger {
    color: #c53030;
    border-color: #feb2b2;
}
.btn-danger:hover { background: #fff5f5; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.toggle-status-form {
    margin: 0 !important;
    display: inline-block;
}

.detail-voted-msg {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #22543d;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.detail-closed-msg {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    padding: 10px 14px;
    text-align: center;
}

/* Box générique pour les sections de contenu */
.card-box {
    border: 1px solid #dddddd;
    border-radius: 12px;
    background: #ffffff;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

/* Boîte d'erreur centrée */
.error-box {
    border: 2px dashed #ff3333;
    border-radius: 12px;
    background: #fcfcfc;
    padding: 40px;
    text-align: center;
    color: var(--accent-color);
    margin: 30px auto;
    max-width: 600px;
}

/* Badges de statut de sondage */
.badge-listed {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #c6f6d5;
}
.badge-discret {
    background: #fffaf0;
    color: #744210;
    border: 1px solid #feebc8;
}
.badge-closed {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

/* Style générique pour les champs de formulaire */
.form-input {
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

@media (max-width: 500px) {
    .screen-card {
        padding: 24px;
    }
    .welcome-title {
        font-size: 1.6rem;
    }
    .nav-controls {
        bottom: 20px;
        right: 20px;
    }
    .scale-icon {
        font-size: 1.2rem;
    }
}
