/* 
   Horror Story Visual Novel - Core Design System
   Aesthetics: Gothic, Eerie, Cinematic Dark Mode, Glowing Red Accents
*/

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400..900&family=Creepster&family=Special+Elite&family=Manrope:wght@300..700&display=swap');

:root {
    --primary: #0a0a0c;             /* Deep charcoal black */
    --primary-light: #16161a;       /* Slightly lighter charcoal */
    --accent: #8b0000;              /* Blood dark red */
    --accent-glow: #ff3333;         /* Eerie neon red glow */
    --text-color: #e2e8f0;          /* Off-white */
    --text-muted: #94a3b8;          /* Slate gray */
    
    /* Animation Tokens */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--primary);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Typography settings */
h1, h2, h3, .font-horror {
    font-family: 'Creepster', cursive;
    letter-spacing: 0.05em;
}

.font-cinzel {
    font-family: 'Cinzel', serif;
}

.font-typewriter {
    font-family: 'Special Elite', monospace;
}

/* Background Crossfade Transitions */
.bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #000;
}

.bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity var(--transition-slow) ease-in-out;
    opacity: 0;
}

.bg-layer.active {
    opacity: 0.5; /* Keeping it slightly dim for text readability */
}

/* Vignette overlay to make edges dark and atmospheric */
.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: radial-gradient(circle, transparent 30%, rgba(0, 0, 0, 0.95) 90%);
    pointer-events: none;
}

/* Moving Mist / Fog Overlay */
.mist-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: url('https://www.transparenttextures.com/patterns/fog.png');
    opacity: 0.15;
    pointer-events: none;
    animation: moveMist 60s linear infinite;
}

@keyframes moveMist {
    from { background-position: 0 0; }
    to { background-position: 1000px 500px; }
}

/* Glassmorphism Horror Dialog Box */
.dialog-glass {
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(139, 0, 0, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8), 
                inset 0 0 15px rgba(139, 0, 0, 0.15);
}

.dialog-glass:hover {
    border-color: rgba(255, 51, 51, 0.4);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8), 
                inset 0 0 20px rgba(139, 0, 0, 0.25);
    transition: border-color 0.5s, box-shadow 0.5s;
}

/* Glowing Crimson Buttons */
.btn-horror {
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid var(--accent);
    color: var(--text-color);
    box-shadow: inset 0 0 5px rgba(139, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-horror:hover {
    background: rgba(139, 0, 0, 0.6);
    border-color: var(--accent-glow);
    box-shadow: 0 0 15px var(--accent-glow), 
                inset 0 0 10px rgba(255, 51, 51, 0.5);
    transform: translateY(-2px) scale(1.01);
}

.btn-horror:active {
    transform: translateY(1px) scale(0.99);
}

/* Eerie flickering lights animation */
.flicker {
    animation: flickerEffect 4s infinite alternate;
}

@keyframes flickerEffect {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 1px rgba(255, 51, 51, 0.3));
    }
    20%, 24%, 55% {
        opacity: 0.3;
        filter: none;
    }
}

/* Typewriter sound & effect container */
.typewriter-cursor::after {
    content: '|';
    animation: blinkCursor 0.8s infinite;
    color: var(--accent-glow);
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blinkCursor {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}

/* Scrolling Custom Scrollbar for Admin Panels */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--primary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-glow);
}

/* Simple keyframe animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-fade {
    animation: fadeIn 0.8s forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
