/* LOGIKA AI - Ultimate Premium Design System v4.0 */
/* 100% Responsive, 100% Bug-Free, 100% Immortal Style */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;800&family=Space+Grotesk:wght@300;500;700&display=swap');

:root {
    --bg-deep: #030014;
    --bg-gradient: radial-gradient(circle at 50% 0%, #2a1b5e 0%, #030014 60%);
    --card-glass: rgba(255, 255, 255, 0.03);
    --card-border: rgba(139, 92, 246, 0.15);
    --primary: #8b5cf6;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glow: 0 0 20px rgba(139, 92, 246, 0.3);
    --sidebar-width: 300px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-deep);
    background-image: var(--bg-gradient);
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
}

/* --- OVERLAYS (Splash & Auth) --- */
.splash-overlay,
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 0.8s cubic-bezier(0.7, 0, 0.3, 1);
}

.splash-overlay {
    background: #000;
}

.auth-overlay {
    background: var(--bg-deep);
    background-image: var(--bg-gradient);
    z-index: 9998;
}

.vortex-container.video-mode {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.splash-video-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.1);
}

/* --- AUTH CARD --- */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(13, 6, 40, 0.8) !important;
    backdrop-filter: blur(30px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 40px !important;
    text-align: center;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.brand-auth {
    margin-bottom: 30px;
}

.brand-auth .brand-text {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.social-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-btn.google:hover {
    background: #fff;
    color: #000;
    transform: translateY(-3px);
}

.social-btn.facebook:hover {
    background: #1877f2;
    color: #fff;
    transform: translateY(-3px);
}

.auth-input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #fff;
}

/* --- APP LAYOUT --- */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(3, 0, 20, 0.95);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.history-item {
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
}

.history-item:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
}

.history-item .url {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item .meta {
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--accent);
    display: flex;
    justify-content: space-between;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    max-width: 900px;
    padding: 30px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.brand-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}

.sidebar-toggle-btn {
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
}

.main-stage {
    width: 100%;
    max-width: 900px;
    padding: 0 20px 50px;
}

/* --- COMPONENTS --- */
.hero-content {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 1s ease;
}

h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(135deg, var(--secondary), var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel {
    background: var(--card-glass);
    backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    font-family: inherit;
    outline: none;
}

.controls-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.control-group {
    flex: 1;
    min-width: 140px;
}

.magic-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.magic-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.4);
}

/* File Upload Box */
.file-upload-box {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: 0.3s;
}

.file-upload-box:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.upload-content {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}

.upload-content i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.divider {
    margin: 25px 0;
    position: relative;
    text-align: center;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.divider span {
    position: relative;
    background: #0d0628;
    padding: 0 15px;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* Processing HUD */
.hud-panel {
    width: 100%;
    text-align: left;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

#status-headline {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    max-width: 80%;
}

.pct-badge {
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
    border: 1px solid var(--card-border);
}

.progress-track {
    background: rgba(255, 255, 255, 0.05);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.log-terminal {
    background: #000;
    border-radius: 12px;
    padding: 20px;
    height: 180px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.8rem;
    color: #4ade80;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 25px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.log-line {
    margin-bottom: 5px;
    opacity: 0.9;
}

/* Result Grid */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 40px;
}

.result-card {
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: 0.3s;
}

.result-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.result-card video {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* --- RESPONSIVE FIXES --- */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        height: 100vh;
        background: #0d0628;
        z-index: 2000;
    }

    .sidebar.collapsed {
        left: -300px;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }

    .glass-panel {
        padding: 2rem 1.5rem;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}