/* Midnight Glass Theme - Premium */
:root {
    --bg-color: #030407;
    --glass-bg: rgba(20, 25, 35, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-sheen: linear-gradient(125deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.01) 30%, transparent 100%);
    --text-main: #f0f6fc;
    --text-muted: #8b949e;

    /* Vibrant Accents */
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.5);

    --error: #ef4444;
    --success: #10b981;

    --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    --header-gradient: linear-gradient(to right, #fff, #b4c6ef);
}

[data-theme="light"] {
    --bg-color: #e5e7eb;
    /* Darker gray for better contrast */
    --glass-bg: rgba(255, 255, 255, 0.65);
    /* Less opaque to pick up the darker bg */
    --glass-border: rgba(255, 255, 255, 0.4);
    /* White-ish border for "glass edge" look */
    --glass-sheen: linear-gradient(125deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.1) 30%, transparent 100%);
    --text-main: #111827;
    /* Near black */
    --text-muted: #4b5563;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.2);

    --card-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 10px 20px -5px rgba(0, 0, 0, 0.05);
    /* Deeper shadow */
    --header-gradient: linear-gradient(to right, #1f2937, #4b5563);
    /* Dark text gradient */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05), transparent 60%);
    z-index: -1;
    pointer-events: none;
    animation: pulseBg 15s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #8b949e);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-controls {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 1rem;
    padding: 0;
}

.btn-text:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Containers */
.app-container {
    flex: 1;
    max-width: 600px;
    margin: 3rem auto;
    width: 100%;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--border-highlight);
    border-left: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

/* Subtle sheen effect */
.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-sheen);
    pointer-events: none;
    z-index: 1;
}

.glass-card>* {
    position: relative;
    z-index: 2;
}

.login-container {
    padding: 2.5rem;
    text-align: center;
    max-width: 400px;
    margin: auto;
    /* for login page specifically which is centered by body flex if not using base layout, 
       but if using base layout, this needs adjustment. 
       We reused login-container class in login.html matching previous plain css.
       Here we make it look like a glass card too.
    */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}


h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--header-text);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--header-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Forms & Inputs */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

/* Ensure options are readable in light mode */
select option {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-danger {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--error), #dc2626);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-special {
    width: 100%;
    padding: 24px;
    /* Increased from 16px */
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-special:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
}

.btn-special:active {
    transform: translateY(0);
}

/* Utility */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.hidden {
    display: none;
}

/* Cookie Status */
.cookie-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-green {
    background-color: var(--success);
    box-shadow: 0 0 8px rgba(46, 160, 67, 0.4);
}

.status-red {
    background-color: var(--error);
}

/* Thumbnails */
.video-preview {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
    aspect-ratio: 16/9;
}

.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

/* Progress */
.progress-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
    width: 0%;
    transition: width 0.3s linear;
    box-shadow: 0 0 15px var(--accent-glow);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(45deg,
            rgba(255, 255, 255, 0.15) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.15) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 0;
    }
}