/* --- CSS STYLES --- */
:root {
    --glow-color-1: #00c6ff;
    --glow-color-2: #e000c6;
    --bg-color-1: #1a0d33;
    --bg-color-2: #0d1a33;
    --container-bg: rgba(15, 15, 25, 0.75);
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #e0e0e0;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
    /* FIX: Allow vertical scrolling */
    position: relative;
    background-color: #0d0d1a;
    /* Fallback background */
    transition: background-color 0.5s ease;
}

.aurora-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at 70% 30%, var(--bg-color-1), transparent),
        radial-gradient(ellipse at 30% 70%, var(--bg-color-2), transparent);
    animation: move-aurora 20s ease-in-out infinite alternate;
    transition: background 0.5s ease;
}

@keyframes move-aurora {
    0% {
        transform: scale(1) rotate(0deg);
    }

    100% {
        transform: scale(1.5) rotate(180deg);
    }
}

.container {
    background: var(--container-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    padding: 2rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    max-width: 680px;
    width: 100%;
    z-index: 1;
    transition: box-shadow 0.3s ease, background 0.5s ease;
}

.container:hover {
    box-shadow: 0 0 40px rgba(0, 198, 255, 0.2), 0 0 40px rgba(224, 0, 198, 0.2);
}

.app-header h1 {
    font-weight: 700;
    font-size: 2.2em;
    color: #fff;
    margin-bottom: 5px;
}

.app-header p {
    font-size: 1em;
    color: #b0b0c0;
}

.video-container {
    position: relative;
    margin: 25px auto;
    width: 100%;
    padding-top: 75%;
    /* 4:3 Aspect Ratio */
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

video,
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.message {
    margin-top: 15px;
    font-size: 1em;
    min-height: 24px;
    color: #c0c0d0;
    font-weight: 400;
}

.advice {
    color: var(--glow-color-1);
    font-style: italic;
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(0, 198, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--glow-color-1);
    text-align: left;
    transition: all 0.5s ease;
}

.score-container {
    transition: transform 0.3s ease;
}

.score-container h2 {
    font-weight: 600;
    font-size: 1.5em;
    color: #fff;
}

.score-container span {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 10px var(--glow-color-1), 0 0 20px var(--glow-color-1);
    transition: text-shadow 0.3s ease;
}

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    margin: 35px 0;
}

.mood-section h2,
.pep-talk-section h2,
.theme-section h2 {
    font-weight: 600;
    font-size: 1.2em;
    color: #e0e0e0;
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

input[type="text"],
textarea {
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 1em;
    width: 90%;
    color: #fff;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: #a0a0b0;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--glow-color-1);
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.3);
}

button {
    padding: 12px 25px;
    border: none;
    background: linear-gradient(45deg, var(--glow-color-1), var(--glow-color-2));
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 20px rgba(224, 0, 198, 0.4);
}

button:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pep-talk-display {
    margin-top: 15px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: left;
    white-space: pre-wrap;
    font-size: 0.95em;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

@media (min-width: 600px) {
    .input-group {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .app-header h1 {
        font-size: 1.8em;
    }

    .score-container h2,
    .mood-section h2,
    .pep-talk-section h2,
    .theme-section h2 {
        font-size: 1.1em;
    }

    button {
        width: 100%;
    }

    .input-group {
        width: 100%;
    }
}