/* 
   REMIX AI - PREMIUM DESIGN SYSTEM
   Theme: Cyber-Glass / Modern Dark
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Orbitron:wght@700&family=JetBrains+Mono&display=swap');

:root {
    /* Colors */
    --bg-deep: #050508;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-surface-elevated: rgba(255, 255, 255, 0.07);

    --accent-primary: #00f2fe;
    /* Cyber Cyan */
    --accent-secondary: #4facfe;
    /* Deep Blue */
    --accent-vibrant: #7000ff;
    /* Electric Violet */
    --accent-glow: rgba(0, 242, 254, 0.5);

    --text-main: #f8f9fa;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --border-glass: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(0, 242, 254, 0.2);

    /* Layout */
    --sidebar-width: 280px;
    --card-radius: 20px;
    --transition-smooth: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

.spa-layout {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* --- Background Orbs --- */
.glass-bg {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(112, 0, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(0, 242, 254, 0.1) 0%, transparent 40%),
        #050508;
    z-index: -2;
}

.mesh-gradient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.mesh-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(79, 172, 254, 0.2);
    top: -200px;
    right: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(0, 242, 254, 0.15);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: rgba(112, 0, 255, 0.1);
    top: 30%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 10, 15, 0.4);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 32px 16px;
    z-index: 10;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 48px;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
    margin-top: auto;
    padding: 24px 16px 0;
    border-top: 1px solid var(--border-glass);
}

.storage-info {
    margin-bottom: 24px;
}

.storage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.storage-bar {
    height: 6px;
    background: var(--bg-surface-elevated);
    border-radius: 10px;
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-vibrant));
    border-radius: 10px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent-vibrant);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-plan {
    font-size: 0.7rem;
    color: var(--accent-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item:hover {
    background: var(--bg-surface);
    color: #fff;
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(112, 0, 255, 0.1));
    color: var(--accent-primary);
    box-shadow: inset 0 0 0 1px var(--border-accent);
}

.nav-item.active i {
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* --- Views --- */
.main-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
    scroll-behavior: smooth;
}

.view-panel {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInView 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-panel.active {
    display: block;
}

@keyframes fadeInView {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.view-header {
    margin-bottom: 40px;
}

.view-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.highlight-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-vibrant));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.view-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Components --- */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-glass);
    border-radius: var(--card-radius);
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.generator-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 32px;
}

.panel-header h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Inputs --- */
.input-group {
    margin-bottom: 24px;
}

.input-wrapper {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 242, 254, 0.1);
}

input[type="text"],
select {
    width: 100%;
    background: transparent;
    border: none;
    padding: 16px 20px;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

input[type="text"]::placeholder {
    color: var(--text-dim);
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-primary);
}

.input-wrapper input {
    padding-left: 50px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 700;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-glass);
}

.divider:not(:empty)::before {
    margin-right: 1.5em;
}

.divider:not(:empty)::after {
    margin-left: 1.5em;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    /* CRITICAL FIX */
}

/* Redefine switch sizing inside label */
.switch-label .slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch-label input {
    display: none;
}

.switch-label .slider::before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.switch-label input:checked+.slider:before {
    transform: translateX(16px);
}

.styled-select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #fff;
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
}

.file-drop-area {
    border: 2px dashed var(--border-glass);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 18px;
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.file-drop-area:hover {
    background: rgba(0, 242, 254, 0.03);
    border-color: var(--accent-primary);
}

.drop-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 16px;
    opacity: 0.7;
}

/* --- Buttons --- */
.cta-button {
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-smooth);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 242, 254, 0.3);
}

/* --- Tabs / Filters --- */
.gallery-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 8px 24px;
    border-radius: 100px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-btn:hover {
    background: var(--bg-surface-elevated);
    color: #fff;
}

.filter-btn.active {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- Library Specifics --- */
.gallery-container {
    margin-top: 20px;
    min-height: 500px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.result-card {
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
}

.result-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-thumb {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    display: block;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.result-card:hover .card-overlay {
    opacity: 1;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #fff;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.card-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.download-btn {
    background: var(--accent-primary);
    color: #000;
    text-decoration: none;
}

.delete-btn {
    background: rgba(255, 60, 60, 0.2);
    color: #ff3c3c;
    border: 1px solid rgba(255, 60, 60, 0.3);
}

.delete-btn:hover {
    background: #ff3c3c;
    color: #fff;
}

/* --- Terminal Redesign --- */
.terminal-container {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 20px;
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
}

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-body {
    height: 180px;
    padding: 16px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}

.log-line {
    display: grid;
    grid-template-columns: auto 20px 1fr;
    gap: 12px;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.log-line:hover {
    background: rgba(255, 255, 255, 0.03);
}

.log-timestamp {
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 500;
}

.log-prompt {
    color: var(--accent-primary);
    font-weight: 800;
}

.log-text {
    color: #e2e8f0;
    word-break: break-word;
}

.log-text.success {
    color: #22c55e;
}

.log-text.error {
    color: #ef4444;
}

.log-text.info {
    color: var(--accent-secondary);
}

/* --- Settings --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.setting-row:last-child {
    border-bottom: none;
}

/* --- Switches --- */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--bg-surface-elevated);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border-glass);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: #000;
}

/* --- History List --- */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
}

.history-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    transition: var(--transition-smooth);
}

.history-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.history-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-surface-elevated);
}

.history-row:has(.processing) .history-icon {
    color: var(--accent-primary);
}

.history-row:has(.completed) .history-icon {
    color: #22c55e;
}

.history-row:has(.failed) .history-icon {
    color: #ef4444;
}

.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    /* Prevents overflow in grid */
}

.history-source {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-divider {
    width: 4px;
    height: 4px;
    background: var(--border-glass);
    border-radius: 50%;
}

.status-tag {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-tag.processing {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.status-tag.completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-tag.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- Utils --- */
.hidden {
    display: none !important;
}

.fade-out {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}
/* --- Dynamic Tracking Settings Styles --- */
.setting-row.vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.setting-info small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.range-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: var(--transition-smooth);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-value {
    font-family: "Orbitron", sans-serif;
    font-size: 0.8rem;
    color: var(--accent-primary);
    min-width: 60px;
    text-align: right;
}
