/* ==========================================================================
   NeuDebrid - Sleek Glassmorphism Dark Mode Design System
   Optimized for Ubuntu 24.04+ (PHP 8.3+)
   ========================================================================== */

:root {
    --bg-base: #080c14;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-glass: rgba(15, 23, 42, 0.72);
    --bg-glass-card: rgba(30, 41, 59, 0.55);
    --bg-glass-input: rgba(15, 23, 42, 0.85);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --border-accent: rgba(99, 102, 241, 0.45);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #818cf8;

    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.25);

    --cyan-primary: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.2);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);

    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 25px var(--accent-glow);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow */
.app-bg-glow, .login-bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.6) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */
.app-header {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.brand-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--accent-primary));
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-badge-version {
    font-size: 0.7rem;
    background: rgba(99, 102, 241, 0.18);
    color: var(--text-accent);
    border: 1px solid var(--border-accent);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-weight: 600;
}

.status-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.yellow {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.status-dot.red {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.status-dot.grey {
    background-color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fidelity-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Tabs Navigation Bar */
.tabs-nav {
    background: rgba(15, 23, 42, 0.45);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tabs-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    gap: 0.25rem;
    padding: 0.4rem 1.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.22);
    border: 1px solid var(--border-accent);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.tab-badge {
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-weight: 700;
}

/* ==========================================================================
   Professional Vector SVG Icons
   ========================================================================== */
.neu-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.2em;
    flex-shrink: 0;
    transition: transform 0.15s ease, stroke 0.15s ease;
}

.tab-icon .neu-icon {
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.22em;
}

.brand-icon .neu-icon {
    width: 1.5rem;
    height: 1.5rem;
    stroke: #818cf8;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
    vertical-align: middle;
}

.dropzone-icon .neu-icon {
    width: 2.75rem;
    height: 2.75rem;
    stroke: var(--text-muted);
    margin-bottom: 0.5rem;
}

.folder-card-icon .neu-icon {
    width: 1.75rem;
    height: 1.75rem;
    stroke: #60a5fa;
}

.btn .neu-icon {
    margin-right: 0.4rem;
}

.btn.btn-icon-only .neu-icon,
.btn.btn-ghost .neu-icon,
.breadcrumb-chip .neu-icon {
    margin-right: 0.25rem;
}

.text-success { stroke: var(--success); color: var(--success); }
.text-danger { stroke: var(--danger); color: var(--danger); }
.text-warning { stroke: var(--warning); color: var(--warning); }
.text-primary { stroke: var(--primary-accent); color: var(--primary-accent); }

/* ==========================================================================
   Main Layout & Content Area
   ========================================================================== */
.app-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.25s ease forwards;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Generic Cards */
.card {
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #fff;
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.section-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 1rem 0;
}

/* Grids */
.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.5rem;
}

/* ==========================================================================
   Form Controls, Inputs, Buttons
   ========================================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--bg-glass-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.92rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-input-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
}

.form-textarea {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    resize: vertical;
    line-height: 1.45;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(15, 23, 42, 0.95);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .form-input {
    padding-right: 3rem;
}

.input-action-btn {
    position: absolute;
    right: 0.6rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.input-action-btn:hover {
    color: var(--text-primary);
}

/* Form Layout Helpers */
.form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

/* Custom Checkbox */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid var(--border-hover);
    background: var(--bg-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '✓';
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-danger-outline {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--danger);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* Spinner */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Debrider & Unlocked Results UI
   ========================================================================== */
.password-row {
    margin-top: 0.75rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.input-with-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.debrider-action-buttons {
    display: flex;
    gap: 0.5rem;
}

.delayed-tracker {
    margin-top: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.delayed-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.delayed-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(245, 158, 11, 0.2);
    border-top-color: var(--warning);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.delayed-text {
    display: flex;
    flex-direction: column;
    font-size: 0.88rem;
}

.unlocked-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.unlocked-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: border-color 0.2s;
}

.unlocked-item:hover {
    border-color: var(--border-accent);
}

.unlocked-file-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}

.unlocked-filename {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unlocked-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.host-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.unlocked-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ==========================================================================
   Torrents & Dropzone
   ========================================================================== */
.magnet-input-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .magnet-input-grid {
        grid-template-columns: 1fr;
    }
}

.torrent-dropzone {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.4);
    transition: all 0.2s ease;
    text-align: center;
}

.torrent-dropzone:hover, .torrent-dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

.dropzone-icon {
    font-size: 2rem;
}

.dropzone-text {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.dropzone-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.table-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-group {
    display: flex;
    gap: 0.25rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

.live-sync-indicator {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ==========================================================================
   Data Tables
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.5);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.data-table th {
    background: rgba(30, 41, 59, 0.6);
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Progress bar */
.progress-bar-wrapper {
    width: 100%;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.08);
    height: 8px;
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--cyan-primary));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    display: block;
    font-family: var(--font-mono);
}

/* Status Labels */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-info    { background: rgba(99, 102, 241, 0.15); color: var(--text-accent); }
.badge-muted   { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.badge-purple  { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }

.archive-info-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

/* ==========================================================================
   Hosters & Quotas Matrix
   ========================================================================== */
.user-quotas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.quota-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.quota-host-name {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.quota-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--cyan-primary);
}

.hosts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.75rem;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.host-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
    max-width: 800px;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #fff;
}

.stream-qualities-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 380px;
    overflow-y: auto;
}

.stream-quality-btn {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.stream-quality-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
}

/* Torrent File Tree */
.torrent-files-tree {
    max-height: 450px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.tree-node {
    padding: 0.35rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-sm);
}

.tree-node:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tree-folder {
    font-weight: 700;
    color: #38bdf8;
    margin-top: 0.5rem;
}

.tree-file {
    padding-left: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    color: #fff;
    font-size: 0.88rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastSlideIn 0.25s ease forwards;
    min-width: 260px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger);  }
.toast.info    { border-left: 4px solid var(--accent-primary); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   Login Page Styling
   ========================================================================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-card {
    padding: 2.5rem;
    text-align: center;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.brand-badge .brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.warp-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: #22d3ee;
    margin-bottom: 1.75rem;
}

.login-form {
    text-align: left;
}

.remember-row {
    margin-bottom: 1.25rem;
}

.alert-box {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.alert-box.error {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.login-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.divider { height: 1px; background: var(--border-subtle); border: none; }

/* -------------------------------------------------------------------------
 * File Manager & Breadcrumbs
 * ------------------------------------------------------------------------- */
.file-breadcrumbs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    overflow-x: auto;
}

.file-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.breadcrumb-chip {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.breadcrumb-chip:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.breadcrumb-chip.active {
    color: var(--primary-accent);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.breadcrumb-separator {
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 0.8rem;
}

.section-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-sub-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* Folders Grid */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.85rem;
}

.folder-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all 0.25s ease;
    cursor: pointer;
}

.folder-card:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: var(--primary-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.folder-card-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    flex: 1;
}

.folder-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.folder-card-info {
    overflow: hidden;
}

.folder-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.folder-delete-btn {
    opacity: 0.6;
    padding: 0.25rem 0.45rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.folder-delete-btn:hover {
    opacity: 1;
    background: var(--danger-bg);
    color: var(--danger);
}

/* Clickable File Row & Media Badges */
.file-name-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.file-name-link {
    cursor: pointer;
    color: #f8fafc;
    font-weight: 500;
    transition: color 0.15s;
    text-decoration: none;
}

.file-name-link:hover {
    color: var(--primary-accent);
    text-decoration: underline;
}

.media-play-indicator {
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-left: 0.5rem;
    cursor: pointer;
}

.media-play-indicator:hover {
    background: rgba(99, 102, 241, 0.35);
    color: #fff;
}

/* -------------------------------------------------------------------------
 * Media Preview Modal (Player & Viewer)
 * ------------------------------------------------------------------------- */
.modal-card.modal-xl {
    max-width: 960px;
    width: 95%;
}

.media-modal-header-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
}

.media-modal-body {
    padding: 0;
    background: #020617;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.media-viewer-container {
    width: 100%;
    min-height: 250px;
    max-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.media-viewer-container video {
    width: 100%;
    max-height: 70vh;
    outline: none;
    background: #000;
}

.media-viewer-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.media-viewer-container audio {
    width: 90%;
    max-width: 600px;
    margin: 3rem 0;
}

.media-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.media-modal-actions {
    display: flex;
    gap: 0.6rem;
}

/* ==========================================================================
   Module: File Manager Batch Actions & Multi-Select
   ========================================================================== */
.batch-action-bar {
    position: sticky;
    top: 75px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-lg);
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--primary-500);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.3);
    animation: slideDownFade 0.2s ease-out;
}

.batch-action-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.batch-count-badge {
    background: var(--primary-500);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.batch-action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.w-checkbox {
    width: 44px;
    text-align: center;
}

.data-table td.cell-checkbox {
    text-align: center;
}

.data-table tr.selected-row {
    background: rgba(99, 102, 241, 0.14) !important;
}

.drag-over-active {
    outline: 2px dashed var(--primary-500) !important;
    outline-offset: -4px;
    background: rgba(99, 102, 241, 0.08) !important;
}

/* ==========================================================================
   Module: Public File Sharing Landing Page & Cinema Media Player
   ========================================================================== */
.share-page-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #080c14;
    color: var(--text-main, #f8fafc);
    position: relative;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.share-page-container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 10;
}

/* For generic non-media files, keep a centered elegant card */
.share-page-container.is-file-share {
    max-width: 660px;
    margin: auto auto;
    padding: 2.5rem 1.25rem;
}

/* Top Navigation Bar */
.share-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 12px);
}

.share-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.share-brand .brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-500, #6366f1), #8b5cf6);
    border-radius: 8px;
    color: #ffffff;
}

.share-brand .brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.share-brand .brand-pill {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.18);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 9999px;
}

.share-top-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Main Content Area */
.share-main-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Cinema Video Player */
.share-cinema-player-box {
    width: 100%;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl, 16px);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.15);
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 74vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cinema-video {
    width: 100%;
    height: 100%;
    max-height: 74vh;
    outline: none;
    object-fit: contain;
    background: #000000;
}

.video-error-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    gap: 0.75rem;
}

/* Image Preview */
.share-image-preview-box {
    width: 100%;
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1rem;
    overflow: hidden;
}

.cinema-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Audio Player */
.share-audio-player-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 3.5rem 2rem;
    border-radius: var(--radius-xl);
}

.audio-visual-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cinema-audio {
    width: 100%;
    max-width: 650px;
    outline: none;
}

/* File Details Card */
.share-details-card {
    padding: 1.6rem 2rem;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.share-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.share-file-icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: rgba(99, 102, 241, 0.14);
    color: var(--primary-400, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.share-file-info {
    flex: 1;
    min-width: 260px;
}

.share-file-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.45rem 0;
    word-break: break-word;
    line-height: 1.35;
}

.share-file-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.share-primary-download-btn-wrap {
    flex-shrink: 0;
}

.download-btn {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.share-link-copy-section {
    padding-top: 1.15rem;
    border-top: 1px solid var(--border-subtle);
}

.stream-link-hint {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stream-code-url {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-subtle);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    user-select: all;
    word-break: break-all;
    font-family: 'JetBrains Mono', monospace;
}

.share-footer {
    text-align: center;
    font-size: 0.825rem;
    color: var(--text-muted);
    padding: 0.5rem 0 1rem;
}

.share-result-box {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-md);
    padding: 0.85rem;
}

.input-action-row {
    display: flex;
    gap: 0.5rem;
}

.input-action-row input {
    flex: 1;
}

@media (max-width: 768px) {
    .share-page-container {
        padding: 1rem 0.75rem 2rem;
        gap: 1rem;
    }
    .share-header-bar {
        padding: 0.75rem 1rem;
    }
    .share-details-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .share-primary-download-btn-wrap {
        width: 100%;
    }
    .share-primary-download-btn-wrap .download-btn {
        width: 100%;
        justify-content: center;
    }
    .video-player-wrapper {
        aspect-ratio: auto;
        min-height: 220px;
        max-height: 50vh;
    }
}

