/* CSS Custom Premium - Theme: Dark Glassmorphism Neon */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #0a0d14;
    --bg-surface: rgba(18, 24, 38, 0.65);
    --bg-surface-hover: rgba(26, 34, 54, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.25);
    
    --color-primary: #8b5cf6;
    --color-primary-glow: rgba(139, 92, 246, 0.6);
    --color-secondary: #06b6d4;
    --color-secondary-glow: rgba(6, 182, 212, 0.6);
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #0a0d14;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-speed: 0.3s;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

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

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

/* Background blur decorations */
body::before, body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(150px);
    opacity: 0.15;
}
body::before {
    background: var(--color-primary);
    top: 10%;
    left: 5%;
}
body::after {
    background: var(--color-secondary);
    bottom: 10%;
    right: 5%;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition-speed);
}
a:hover {
    color: var(--color-primary);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
}
.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Auth Layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}
.auth-card {
    width: 100%;
    max-width: 480px;
}
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

/* App Layout Grid */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    background: rgba(10, 13, 20, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-logo {
    margin-bottom: 3rem;
}
.sidebar-logo h2 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-menu {
    list-style: none;
    flex-grow: 1;
}
.sidebar-menu li {
    margin-bottom: 0.75rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-speed);
}
.sidebar-link:hover, .sidebar-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--color-primary);
}
.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

/* Main Area */
.main-content {
    padding: 2.5rem;
    overflow-y: auto;
}
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}
.header-title h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.header-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-surface);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}
.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(10, 13, 20, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-sans);
    transition: all var(--transition-speed);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--border-glow);
}
.form-error {
    color: var(--color-danger);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-speed);
    border: none;
    font-family: var(--font-sans);
}
.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 14px var(--border-glow);
}
.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--color-primary-glow);
}
.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-surface-hover);
    transform: translateY(-2px);
}
.btn-danger {
    background: var(--color-danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.stat-card {
    padding: 1.5rem;
}
.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, #ffffff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 1rem;
}
.stat-progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

/* Video Grid / Cards */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}
.video-card {
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 380px;
}
.video-preview {
    height: 180px;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}
.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}
.video-card:hover .video-preview-overlay {
    opacity: 1;
}
.video-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.video-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-card-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
}
.badge-ready {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.badge-processing {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Billing Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.plan-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 480px;
}
.plan-card.popular {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    transform: scale(1.03);
}
.plan-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1.5rem 0;
}
.plan-price span {
    font-size: 1rem;
    color: var(--text-muted);
}
.plan-features {
    list-style: none;
    margin-bottom: 2rem;
}
.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.plan-features li::before {
    content: '✓';
    color: var(--color-secondary);
    font-weight: bold;
}

/* Detail view / Embed Code */
.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem;
}
.video-player-container {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    background: #000;
}
.code-container {
    position: relative;
    background: rgba(10, 13, 20, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    color: #67e8f9;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.copy-btn:hover {
    background: var(--color-primary);
    color: white;
}

/* Whitelist Domains list */
.domain-list {
    margin-top: 1.5rem;
}
.domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}
.domain-name {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Settings Banner */
.settings-banner {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.settings-banner p {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.settings-banner strong {
    color: var(--text-main);
}

/* Responsive Utilities */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* In production a hamburger menu would toggle this */
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
