/**
 * Frontend styles for Générateur d'Histoire
 * 8-bit retro aesthetic with purple and mint green
 */

.gh-story-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    position: relative;
}

.gh-story-frame {
    background: #1a1a1a;
    border: 6px solid #8b5cf6;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 
        0 0 0 2px #6d28d9,
        0 8px 24px rgba(139, 92, 246, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    position: relative;
}

.gh-story-frame::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    background: linear-gradient(45deg, #8b5cf6 0%, #6d28d9 100%);
    border-radius: 16px;
    z-index: -1;
    opacity: 0.2;
}

.gh-story-screen {
    background: #0f0f0f;
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
}

.gh-slide-image {
    width: 100%;
    background: #1a1a1a;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gh-slide-image img {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.gh-no-image {
    font-size: 64px;
    opacity: 0.3;
}

.gh-slide-text {
    padding: 24px;
    color: #ffffff;
    font-family: 'Courier New', 'Courier', monospace;
    font-size: 16px;
    line-height: 1.8;
    background: rgba(0, 0, 0, 0.6);
    border-top: 2px solid #8b5cf6;
    min-height: 100px;
}

.gh-slide-text p {
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.gh-slide-choices {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gh-choice-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: 3px solid #047857;
    padding: 16px 24px;
    border-radius: 6px;
    font-family: 'Courier New', 'Courier', monospace;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 0 #047857,
        0 6px 12px rgba(16, 185, 129, 0.4);
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gh-choice-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0 #047857,
        0 8px 16px rgba(16, 185, 129, 0.6);
}

.gh-choice-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 0 0 #047857,
        0 2px 8px rgba(16, 185, 129, 0.3);
}

.gh-quit-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #b91c1c;
    box-shadow: 
        0 4px 0 #b91c1c,
        0 6px 12px rgba(239, 68, 68, 0.4);
}

.gh-quit-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 
        0 6px 0 #b91c1c,
        0 8px 16px rgba(239, 68, 68, 0.6);
}

.gh-quit-btn:active {
    box-shadow: 
        0 0 0 #b91c1c,
        0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Mute toggle */
.gh-mute-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.gh-mute-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8b5cf6;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.gh-mute-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #a78bfa;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.6);
}

.gh-mute-btn:active {
    transform: scale(0.95);
}

/* Responsive design */
@media (max-width: 768px) {
    .gh-story-container {
        padding: 10px;
        margin: 20px auto;
    }
    
    .gh-story-frame {
        padding: 20px;
        border-width: 4px;
    }
    
    .gh-slide-text {
        padding: 16px;
        font-size: 14px;
    }
    
    .gh-choice-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .gh-mute-toggle {
        bottom: 10px;
        right: 10px;
    }
    
    .gh-mute-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Accessibility */
.gh-choice-btn:focus,
.gh-mute-btn:focus {
    outline: 3px solid #a78bfa;
    outline-offset: 2px;
}

/* Loading state */
.gh-loading {
    text-align: center;
    padding: 60px 20px;
    color: #8c8f94;
}

.gh-loading::after {
    content: '...';
    animation: gh-dots 1.5s infinite;
}

@keyframes gh-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Pixelated effect for images */
@media (min-resolution: 192dpi) {
    .gh-slide-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Start overlay for audio initialization */
.gh-start-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.gh-btn-start {
    background: linear-gradient(135deg, #1b3a12 0%, #2e5a1b 100%) !important;
    border-color: #2e5a1b !important;
    box-shadow: 
        0 4px 0 #1b3a12,
        0 6px 12px rgba(27, 58, 18, 0.4) !important;
    animation: pulse-start 2s infinite;
}

.gh-btn-start:hover {
    background: linear-gradient(135deg, #2e5a1b 0%, #1b3a12 100%) !important;
    box-shadow: 
        0 6px 0 #1b3a12,
        0 8px 16px rgba(27, 58, 18, 0.6) !important;
}

@keyframes pulse-start {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
