/* Import shared base styles */
@import url('shared/base.css');

/* Custom Twin Peaks Theme Overrides */
:root {
    --primary-color: #930005;
    /* Deep Red */
    --secondary-color: #1a1a1a;
    --accent-color: #d4af37;
    /* Gold/Bronze */
    --background-color: #000000;
    --text-color: #ffffff;
    --card-bg: rgba(0, 0, 0, 0.7);
    --font-family: 'Outfit', sans-serif;
}

/* Global Reset */
* {
    box-sizing: border-box;
}

body {
    background-image: url('assets/red-room-bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    height: 100vh;
    /* Scalable height */
    height: 100dvh;
    /* Mobile fix */
    overflow: hidden;
    /* Prevent body scroll */
    margin: 0;
    display: flex;
    flex-direction: column;
}

.container {
    background: rgba(0, 0, 0, 0.6);
    /* Dark overlay */
    backdrop-filter: blur(5px);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(147, 0, 5, 0.5);
    height: 100%;
    overflow-y: auto;
    /* Internal scroll */
    width: 100%;
    /* Explicit width with box-sizing handles padding */
    max-width: 600px;
    margin: 0 auto;
    /* Center */
    display: flex;
    flex-direction: column;
    /* Ensure no horizontal scroll from children */
    overflow-x: hidden;
}

/* Header */
header {
    margin-bottom: 2rem;
    text-align: center;
    flex-shrink: 0;
}

.logo {
    max-width: 80%;
    height: auto;
    /* Green glow like title */
    filter: drop-shadow(0 0 5px rgba(50, 205, 50, 0.5));
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid #5a0003;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-primary:active {
    background-color: #700004;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    font-weight: 600;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loader-icon {
    font-size: 4rem;
    animation: spin 3s linear infinite;
    margin-bottom: 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

#loading-text {
    font-family: 'Courier New', Courier, monospace;
    /* Typewriter style */
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 1px 1px 2px black;
    font-size: 1.2rem;
    margin-top: 1rem;
}

.progress-bar-bg {
    width: 100%;
    max-width: 300px;
    height: 20px;
    background-color: #1a0000;
    border: 1px solid var(--accent-color);
    /* Gold border */
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    /* Deep red */
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px #ff0000;
}

.progress-bar-fill.indeterminate {
    width: 100%;
    background: linear-gradient(90deg,
            var(--primary-color) 0%,
            #ff0000 50%,
            var(--primary-color) 100%);
    background-size: 200% 100%;
    animation: loadingGradient 2s infinite linear;
}

@keyframes loadingGradient {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

/* Result Container - Fix white background */
#result-container {
    background-color: transparent;
    /* Or black if needed */
    color: var(--text-color);
}

/* Ensure generated text is visible if it has specific class */


/* Footer */
footer {
    border-top: 1px solid var(--primary-color);
    margin-top: auto;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    flex-shrink: 0;
}

.footer-logo {
    height: 30px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-logo:hover {
    filter: grayscale(0%) drop-shadow(0 0 5px var(--accent-color));
    opacity: 1;
}

.footer-text {
    font-size: 0.8rem;
    opacity: 0.7;
    font-family: 'Courier New', Courier, monospace;
}

/* Prompt Modal overrides */
.modal-content {
    background-color: #1a0000;
    border: 2px solid var(--primary-color);
    color: wheat;
}

.modal-content h3 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}

#prompt-textarea {
    background-color: #000;
    color: #0f0;
    /* Matrix code style or FBI terminal */
    font-family: 'Courier New', monospace;
    border: 1px solid #333;
}