:root {
    /* Chaos/Glitch Theme Colors */
    --primary-color: #ff00ff; /* Magenta */
    --secondary-color: #00ffff; /* Cyan */
    --background-color: #111111;
    --text-color: #f0f0f0;
    --input-bg: #222222;
    --shadow: 0 0 10px rgba(255, 0, 255, 0.5); /* Glowing shadow */
    --image-container-bg: #000;
    --warning-color: #ff9900;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #ff00ff; 
        --secondary-color: #00ffff; 
        --background-color: #111111;
        --text-color: #f0f0f0;
        --input-bg: #222222;
        --shadow: 0 0 10px rgba(255, 0, 255, 0.5);
        --image-container-bg: #000;
        --warning-color: #ff9900;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden; /* Prevent scrolling */
    font-family: 'Courier New', monospace; /* Monospace for glitch/terminal feel */
    background-color: var(--background-color);
    color: var(--text-color);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px;
}

#gaudy-title {
    font-size: clamp(1.5em, 5vw, 2.5em);
    text-align: center;
    color: var(--primary-color); /* Magenta */
    text-shadow: 0 0 5px var(--primary-color), 0 0 15px var(--secondary-color); /* Glitchy glow */
    margin-bottom: 10px;
    padding: 5px;
    border: 2px dashed var(--secondary-color);
    background-color: rgba(255, 0, 255, 0.05); /* Slight transparent background */
    letter-spacing: 0.1em;
    animation: glitch 1s infinite alternate;
}

@keyframes glitch {
    0% {
        text-shadow: 0 0 5px var(--primary-color), 2px 2px 0 var(--secondary-color);
        transform: translate(1px, -1px);
    }
    50% {
        text-shadow: 0 0 5px var(--primary-color), -2px -2px 0 var(--secondary-color);
        transform: translate(-1px, 1px);
    }
    100% {
        text-shadow: 0 0 5px var(--primary-color), 0 0 0 var(--secondary-color);
        transform: translate(0, 0);
    }
}

#image-container {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--image-container-bg); 
    margin-bottom: 0;
    border-radius: 4px; /* Sharper corners */
    overflow: hidden;
    box-shadow: 0 0 0 4px var(--secondary-color), var(--shadow); /* Cyan border + glow */
    border: 4px solid var(--primary-color); /* Magenta border */
}

#generated-image {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    background-color: black;
    transition: opacity 0.5s;
    min-height: 50px; 
    filter: saturate(1.2); /* Enhance color for glitch theme */
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
    z-index: 10;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

#loading-animation {
    width: 100px;
    height: 100px;
}

#input-area {
    padding: 0 5px;
    flex-shrink: 0; /* Prevent input area from shrinking */
    margin-bottom: 15px; /* Add space between input and image */
}

#prompt-input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border: 3px solid var(--primary-color); /* Magenta border */
    border-radius: 4px;
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s;
    background-color: var(--input-bg);
    color: var(--text-color);
    min-height: 44px;
    font-family: 'Courier New', monospace;
}

#prompt-input:focus {
    border-color: var(--secondary-color); /* Cyan focus */
    box-shadow: 0 0 8px var(--secondary-color);
}

/* NEW STYLES */
#predicted-prompt-display {
    margin-top: 8px;
    padding: 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1em;
    min-height: 1.5em; /* Ensure it doesn't jump */
    color: var(--warning-color); /* Orange warning color */
    background-color: var(--input-bg);
    border: 1px dashed var(--warning-color);
    text-shadow: 0 0 5px rgba(255, 153, 0, 0.5); /* Soft glow */
    opacity: 0;
    transition: opacity 0.3s ease-in, transform 0.3s ease-in;
    transform: translateX(-5%);
}

#predicted-prompt-display.visible {
    opacity: 1;
    transform: translateX(0);
}