:root {
    --primary-hue: 250;
    --primary: hsl(var(--primary-hue), 100%, 65%);
    --bg-dark: hsl(220, 40%, 10%);
    --card-bg: hsla(220, 40%, 16%, 0.6);
    --glass-border: hsla(0, 0%, 100%, 0.1);
    --text-main: hsl(0, 0%, 95%);
    --text-muted: hsl(220, 20%, 70%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Dynamic Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 10% 20%, hsla(var(--primary-hue), 80%, 40%, 0.2), transparent 40%),
        radial-gradient(circle at 90% 80%, hsla(320, 80%, 40%, 0.2), transparent 40%);
    z-index: -1;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-inner {
    background: hsla(0, 0%, 0%, 0.2);
    border-radius: 12px;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin: 1rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status span {
    font-size: 0.9rem;
    color: #4ade80;
}

/* Main Layout */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 768px) {
    .container {
        flex-direction: row;
        align-items: stretch;
    }
}

/* Cards */
.card {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Input Section */
.input-header h2 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px hsla(var(--primary-hue), 100%, 65%, 0.2);
}

textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    padding: 1.5rem;
    color: var(--text-main);
    font-size: 1.2rem;
    resize: none;
    outline: none;
}

.icon-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: var(--primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-btn:hover {
    transform: scale(1.1);
    background: white;
    color: var(--primary);
}

.icon-btn.recording {
    background: #ef4444;
    animation: pulse 1.5s infinite;
}

.actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), hsl(280, 100%, 65%));
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.primary-btn:hover {
    opacity: 0.9;
}

/* Output Section */
.gloss-display {
    margin-bottom: 1.5rem;
}

.gloss-display h3 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.gloss-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gloss-tag {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.video-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    gap: 1rem;
}

.video-placeholder i {
    font-size: 3rem;
    opacity: 0.5;
}

/* Loader */
.loader {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.loader.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.glass-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}

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

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

#splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.vista-splash-text {
    font-family: 'Outfit', sans-serif;
    font-size: 12vw;
    /* Leaner, still big */
    font-weight: 700;
    /* Bold */
    color: var(--primary);
    position: relative;
    letter-spacing: 0.2em;
    /* Professional spacing */
    text-transform: uppercase;

    /* Fade In/Out Animation (4s max) */
    opacity: 0;
    animation: textFadeInOut 4s ease-in-out forwards;
}

@keyframes textFadeInOut {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    15% {
        opacity: 1;
        transform: scale(1);
    }

    85% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.05);
    }
}