/* UI Components Styles */

/* Messaging Panel */
.messaging-panel {
    background: linear-gradient(180deg, var(--message-bg) 0%, var(--bg-tertiary) 100%);
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

.messaging-header {
    background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    padding: clamp(10px, 2vw, 15px) clamp(15px, 3vw, 20px);
    border-bottom: 1px solid var(--border-color);
}

.messaging-title {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: clamp(12px, 2.5vw, 16px);
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.messaging-subtitle {
    font-size: clamp(10px, 1.5vw, 12px);
    color: var(--text-secondary);
    margin-top: 5px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: clamp(10px, 2vw, 15px);
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vw, 15px);
}

/* Messages */
.message {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: clamp(8px, 2vw, 15px);
    border-left: 4px solid var(--accent-red);
    animation: messageSlide var(--transition-normal) ease;
    position: relative;
}

.message.resistance {
    border-left-color: var(--revolution-color);
}

.message-sender {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: clamp(10px, 1.5vw, 12px);
    color: var(--accent-red);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message.resistance .message-sender {
    color: var(--revolution-color);
}

.message-content {
    font-size: clamp(12px, 2vw, 14px);
    line-height: 1.4;
    color: var(--text-primary);
}

/* Message Character replacing time */
.message-time {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.message-time::after {
    content: '';
    width: clamp(24px, 4vw, 32px);
    height: clamp(24px, 4vw, 32px);
    background-image: url('/coldn/images/chef.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
    transition: all var(--transition-normal) ease;
}

.message:hover .message-time::after {
    opacity: 1;
    transform: scale(1.1);
}

/* Game Area */
.game-area {
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-primary);
    min-width: 0;
    overflow: hidden;
}

.scene-container {
    flex: 1;
    position: relative;
    margin: 10px auto;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: auto;  /* Permettre le défilement */
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    max-width: min(1000px, calc(100vh * 5/4));
    max-height: min(800px, calc((100vw - 40px) * 4/5));
}

/* Scenes */
.map-scene {
    width: 100%;
    height: 100%;
    background: 
        url('/coldn/images/city-map.png') center/cover no-repeat,
        radial-gradient(circle at center, rgba(22, 33, 62, 0.8) 0%, var(--bg-primary) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 25px, rgba(51, 51, 102, 0.1) 26px, rgba(51, 51, 102, 0.1) 27px),
        repeating-linear-gradient(90deg, transparent, transparent 25px, rgba(51, 51, 102, 0.1) 26px, rgba(51, 51, 102, 0.1) 27px);
    position: relative;
    display: block;
    background-color: var(--bg-primary); /* Fallback if image doesn't load */
}

.cultural-scene {
    width: 100%;
    height: 100%;
    position: relative;
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cultural-scene::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(26, 26, 46, 0.8) 50%, 
        rgba(0, 0, 0, 0.7) 100%);
}

/* Specific Scene Styles */
.cultural-scene.cinema {
    background: linear-gradient(45deg, #1a0000 0%, #2d1b1b 50%, #0a0a0a 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="20" fill="%23333" y="40"/><circle cx="20" cy="30" r="3" fill="%23666"/><circle cx="80" cy="30" r="3" fill="%23666"/></svg>');
    background-size: cover, 50px 50px;
}

.cultural-scene.library {
    background: linear-gradient(45deg, #0f1419 0%, #1a2332 50%, #0a0a0a 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="8" height="80" fill="%23654321" x="10" y="10"/><rect width="8" height="80" fill="%238B4513" x="20" y="10"/><rect width="8" height="80" fill="%23654321" x="30" y="10"/></svg>');
    background-size: cover, 30px 30px;
}

.cultural-scene.street {
    background: linear-gradient(45deg, #0a0a0a 0%, #1a1a1a 50%, #2a2a2a 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="2" fill="%23444" y="50"/><rect width="20" height="100" fill="%23222" x="20"/><rect width="20" height="100" fill="%23222" x="60"/></svg>');
    background-size: cover, 100px 100px;
}

.cultural-scene.gallery {
    background: linear-gradient(45deg, #f0f0f0 0%, #e0e0e0 50%, #d0d0d0 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="30" height="20" fill="%23333" x="10" y="20" stroke="%23000" stroke-width="2"/><rect width="30" height="20" fill="%23333" x="60" y="20" stroke="%23000" stroke-width="2"/></svg>');
    background-size: cover, 80px 80px;
}

.cultural-scene.gaming {
    background: linear-gradient(45deg, #001122 0%, #003344 50%, #001122 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="60" height="40" fill="%23000" x="20" y="30" rx="5"/><circle cx="30" cy="40" r="2" fill="%2300ff00"/><circle cx="40" cy="40" r="2" fill="%23ff0000"/></svg>');
    background-size: cover, 60px 60px;
}

/* Alert styling */
.alert {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, var(--accent-red), #cc1122);
    border: 3px solid var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    animation: alertPulse 1.5s infinite, alertGlow 3s infinite;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.6);
    transition: transform 0.2s ease;
}

.alert:hover {
    transform: scale(1.1);
    animation: none;
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.8);
}

/* Alert icon image */
.alert-icon {
    width: 24px;
    height: 31px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.alert:hover .alert-icon {
    transform: scale(1.1);
}

/* HUD Panel */
.hud-panel {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-left: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    min-width: 0;
}

.logo-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.game-logo {
    max-height: clamp(50px, 8vh, 100px);
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 51, 102, 0.3));
}

.hud-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

.hud-section h3 {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: clamp(11px, 2vw, 14px);
}

/* Gauge */
.gauge-track {
    height: clamp(15px, 3vw, 20px);
    background: linear-gradient(90deg, var(--revolution-color) 0%, var(--regime-color) 100%);
    border-radius: 10px;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 8px;
}

.gauge-cursor {
    width: clamp(4px, 1vw, 6px);
    height: clamp(20px, 4vw, 30px);
    background: white;
    position: absolute;
    top: clamp(-5px, -1vw, -7px);
    border-radius: 3px;
    transition: left var(--transition-slow) ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    border: 2px solid var(--accent-blue);
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: clamp(9px, 1.5vw, 11px);
    font-weight: 600;
    margin-top: 5px;
}

.gauge-label-left { color: var(--revolution-color); }
.gauge-label-right { color: var(--regime-color); }

/* Resource indicators */
.resource-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 4px 0;
    font-size: clamp(11px, 1.8vw, 13px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.resource-item span:last-child {
    font-weight: 700;
    transition: all 0.3s ease;
}

/* Resource warning colors */
.resource-low {
    color: var(--accent-red) !important;
    text-shadow: 0 0 5px rgba(255, 51, 102, 0.5);
    animation: resourceWarning 2s infinite alternate;
}

.resource-critical {
    color: var(--danger-color) !important;
    text-shadow: 0 0 8px rgba(220, 38, 38, 0.8);
    animation: resourceCritical 1s infinite alternate;
}

@keyframes resourceWarning {
    0% { opacity: 1; }
    100% { opacity: 0.7; }
}

@keyframes resourceCritical {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.05); }
}

/* Budget display improvements */
.budget-display {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid var(--border-color);
}

.budget-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: clamp(10px, 1.6vw, 12px);
}

.budget-value {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: clamp(14px, 2.2vw, 16px);
    color: var(--accent-blue);
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
}

/* Decision Buttons */
.decision-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.decision-btn {
    padding: 15px 25px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: linear-gradient(45deg, var(--bg-tertiary), var(--neutral-dark));
    color: var(--text-primary);
    font-family: 'Rajdhani', monospace;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.decision-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    background: linear-gradient(45deg, var(--bg-secondary), var(--bg-tertiary));
}

.decision-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.decision-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--neutral-dark) !important;
    background: linear-gradient(45deg, var(--neutral-dark), var(--neutral-light)) !important;
    pointer-events: none;
}

.decision-btn.obey {
    background: linear-gradient(45deg, var(--bg-tertiary), #404066);
    border-color: var(--border-color);
}

.decision-btn.obey:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
}

.decision-btn.resist {
    background: linear-gradient(45deg, var(--bg-secondary), #2a2a4a);
    border-color: var(--border-color);
}

.decision-btn.resist:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
}

/* Event Display */
.event-display {
    text-align: center;
    padding: 10px;
    max-width: 600px;
    margin: 0 auto;
}
/* Marge en bas pour garantir le défilement dans les événements */
.event-display::after {
    content: '';
    display: block;
    height: 100px; /* Marge en bas pour le défilement */
    width: 100%;
}
.scene-image, .scene-media {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
}

.scene-image img, .scene-media video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.film-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.film-btn {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.film-btn:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Styles pour les boutons de chansons avec icônes */
.decision-btn[style*="background-image"] {
    transition: all 0.3s ease;
}

.decision-btn[style*="background-image"]:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateX(2px);
}

.event-title {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 20px;
    color: var(--accent-red);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.event-type {
    font-family: 'Orbitron', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--accent-blue);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.work-title {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.work-location {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-style: italic;
}

.work-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: justify;
    padding: 0 20px;
}

.work-impact {
    font-size: 14px;
    color: var(--accent-orange);
    margin-bottom: 30px;
    font-weight: 600;
    padding: 10px;
    background: rgba(255, 136, 0, 0.1);
    border-radius: 5px;
    border-left: 4px solid var(--accent-orange);
}

/* History */
.history-container {
    max-height: clamp(150px, 20vh, 300px);
    overflow-y: auto;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 6px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal) ease;
    border-left: 3px solid transparent;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.history-item.regime {
    border-left-color: var(--regime-color);
}

.history-item.resistance {
    border-left-color: var(--revolution-color);
}

.history-title {
    font-weight: 700;
    font-size: clamp(10px, 1.5vw, 12px);
    margin-bottom: 4px;
    color: var(--text-primary);
}

.history-choice {
    font-size: clamp(9px, 1.3vw, 11px);
    color: var(--text-secondary);
    font-style: italic;
}

/* Stress Overlay */
.stress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at center, transparent 20%, rgba(255, 0, 0, 0.1) 40%),
        linear-gradient(45deg, transparent 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    z-index: var(--z-stress);
    transition: opacity var(--transition-slow) ease;
}

.stress-overlay.active {
    opacity: 1;
    animation: stressFlicker 0.5s infinite alternate;
}
.game-over-modal {
    height: 100vh;
}
/* Modals */
.game-over-modal, .flashback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.game-over-content, .flashback-content {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 15px;
    border: 2px solid var(--border-color);
    padding: 35px;
    text-align: center;
    max-width: 550px;
    width: 90%;
    max-height: calc(100vh - 40px); /* Hauteur max moins padding */
    overflow-y: auto; /* Défilement du contenu si nécessaire */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: modalAppear var(--transition-slow) ease;
    margin: auto; /* Centrage vertical automatique */
}

.game-over-title, .flashback-title {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 32px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.game-over-title.regime {
    color: var(--regime-color);
    text-shadow: 0 0 20px rgba(204, 41, 54, 0.5);
}

.game-over-title.revolution {
    color: var(--revolution-color);
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.game-over-title.stalemate {
    color: var(--accent-blue);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.game-over-description, .flashback-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
    color: var(--text-secondary);
}

.final-stats {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.restart-btn, .flashback-close {
    padding: 12px 35px;
    margin-bottom: 50px;
    background: linear-gradient(45deg, var(--accent-blue), #00a8ff);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Rajdhani', monospace;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-normal) ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.restart-btn:hover, .flashback-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}