/* ═══════════════════════════════════════════════════
   YT MultiTracker Pro — Global Styles
   Dark Glassmorphism Design System
   ═══════════════════════════════════════════════════ */

@import url('variables.css');

/* ─── Reset & Base ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image: var(--bg-gradient);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient-radial);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent-purple);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* ═══════════════════════════════════════════
   LAYOUT — Sidebar + Content
   ═══════════════════════════════════════════ */

.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-sticky);
    background: rgba(3, 8, 20, 0.85);
    backdrop-filter: var(--glass-blur-heavy);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-smooth);
    overflow: hidden;
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--topbar-height);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
}

.nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--space-4) var(--space-3) var(--space-2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-cyan);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.sidebar-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--glass-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-username {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-role {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ─── Top Bar ─── */
.topbar {
    height: var(--topbar-height);
    padding: 0 var(--space-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(3, 8, 20, 0.6);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.page-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 18px;
    position: relative;
}

.topbar-btn:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.topbar-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

/* ─── Page Content ─── */
.page-content {
    padding: var(--space-8);
}


/* ═══════════════════════════════════════════
   GLASS CARDS
   ═══════════════════════════════════════════ */

.glass-card {
    background: linear-gradient(145deg, rgba(13, 27, 42, 0.72) 0%, rgba(8, 18, 32, 0.85) 100%);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all var(--transition-smooth);
}

.glass-card:hover {
    background: linear-gradient(145deg, rgba(16, 33, 52, 0.78) 0%, rgba(10, 22, 40, 0.88) 100%);
    border-color: rgba(0, 212, 255, 0.25);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 212, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.glass-card-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}


/* ═══════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.stat-card-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card-icon.cyan {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
}
.stat-card-icon.purple {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent-purple);
}
.stat-card-icon.green {
    background: var(--success-bg);
    color: var(--success);
}
.stat-card-icon.red {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-card-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-1);
}

.stat-card-change {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}


/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.15);
}
.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.25);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border-color: var(--glass-border);
}
.btn-secondary:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}
.btn-danger:hover {
    background: rgba(255, 71, 87, 0.2);
    box-shadow: var(--shadow-glow-danger);
}

.btn-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}
.btn-success:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: var(--shadow-glow-success);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-2) var(--space-3);
}
.btn-ghost:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-md);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

.btn:disabled, .btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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


/* ═══════════════════════════════════════════
   FORM INPUTS
   ═══════════════════════════════════════════ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-helper {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--font-size-xs);
    color: var(--danger);
    margin-top: var(--space-1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-5);
}


/* ═══════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}
.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
    animation: pulse-glow-red 3s infinite;
}
.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}
.badge-muted {
    background: rgba(71, 85, 105, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(71, 85, 105, 0.3);
}
.badge-dark {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

/* ─── Next-Gen Video Badges ─── */
.badge-short {
    background: linear-gradient(135deg, rgba(255, 10, 84, 0.22) 0%, rgba(255, 107, 0, 0.22) 100%);
    color: #ff4d79;
    border: 1px solid rgba(255, 10, 84, 0.5);
    box-shadow: 0 0 12px rgba(255, 10, 84, 0.25);
    font-weight: 700;
    letter-spacing: 0.3px;
    animation: glow-short 2.5s infinite alternate;
}

@keyframes glow-short {
    0% { box-shadow: 0 0 6px rgba(255, 10, 84, 0.2); }
    100% { box-shadow: 0 0 14px rgba(255, 10, 84, 0.45); }
}

.badge-long {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.18) 0%, rgba(59, 130, 246, 0.2) 100%);
    color: #38bdf8;
    border: 1px solid rgba(0, 212, 255, 0.45);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-strike {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(185, 28, 28, 0.35) 100%);
    color: #fca5a5;
    border: 1px solid #ef4444;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
    font-weight: 700;
    animation: pulse-glow-red 2s infinite;
}

.badge-age {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(239, 68, 68, 0.2) 100%);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
    font-weight: 700;
}

.badge-kids {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.45);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
    font-weight: 600;
}

/* ─── Quick Filter Pills ─── */
.pill-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: var(--space-4);
}

.pill-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.pill-filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.35);
    transform: translateY(-1px);
}

.pill-filter-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.22) 0%, rgba(124, 58, 237, 0.25) 100%);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.35);
}

.pill-filter-btn .pill-count {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.pill-filter-btn.active .pill-count {
    background: rgba(0, 212, 255, 0.25);
    color: #ffffff;
}

@keyframes pulse-glow-red {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 8px rgba(255, 71, 87, 0.3); }
}

/* ─── Standard & Enhanced Table ─── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table thead {
    background: rgba(255, 255, 255, 0.02);
}

.table th {
    padding: var(--space-4) var(--space-4);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table tbody tr {
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(0, 212, 255, 0.035);
}


/* ═══════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════ */

.data-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.data-table thead {
    background: rgba(255, 255, 255, 0.03);
}

.data-table th {
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.data-table th:hover {
    color: var(--text-secondary);
}

.data-table th.sorted {
    color: var(--accent-cyan);
}

.data-table td {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

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

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

.table-thumbnail {
    width: 60px;
    height: 34px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.table-title {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-actions {
    display: flex;
    gap: var(--space-2);
}

.table-empty {
    text-align: center;
    padding: var(--space-16) var(--space-8) !important;
    color: var(--text-muted);
}

.table-empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}


/* ═══════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) 0;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.page-btn {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-width: 36px;
    justify-content: center;
}

.page-btn:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.page-dots {
    padding: var(--space-2);
    color: var(--text-muted);
}


/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: var(--space-5);
    right: var(--space-5);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 300px;
    max-width: 450px;
    box-shadow: var(--shadow-xl);
    pointer-events: auto;
    animation: toast-in 0.4s var(--transition-spring) forwards;
    font-size: var(--font-size-sm);
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--accent-cyan); }

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    flex-shrink: 0;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
}


/* ═══════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-spring);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--glass-border);
}


/* ═══════════════════════════════════════════
   SEARCH OVERLAY
   ═══════════════════════════════════════════ */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-box {
    width: 100%;
    max-width: 600px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(-20px);
    transition: transform var(--transition-spring);
}

.search-overlay.active .search-box {
    transform: scale(1) translateY(0);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--glass-border);
}

.search-input-wrapper .search-icon {
    font-size: 20px;
    color: var(--text-muted);
}

.search-main-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-family: var(--font-family);
    outline: none;
}

.search-main-input::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-3);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover, .search-result-item.selected {
    background: var(--glass-bg-hover);
}


/* ═══════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════ */

.skeleton {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.03) 25%, 
        rgba(255,255,255,0.06) 50%, 
        rgba(255,255,255,0.03) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--space-3);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

.skeleton-thumbnail {
    width: 60px;
    height: 34px;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}


/* ═══════════════════════════════════════════
   QUOTA WIDGET
   ═══════════════════════════════════════════ */

.quota-widget {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.quota-circle {
    width: 80px;
    height: 80px;
    position: relative;
}

.quota-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.quota-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 4;
}

.quota-circle-fill {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.quota-circle-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.quota-info {
    flex: 1;
}

.quota-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}

.quota-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
}


/* ═══════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
    width: auto;
    min-width: 160px;
}

.filter-search {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}


/* ═══════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════ */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.chart-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.chart-title {
    font-size: var(--font-size-md);
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 280px;
}


/* ═══════════════════════════════════════════
   ALERT ITEMS
   ═══════════════════════════════════════════ */

.alert-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.alert-item.unread {
    border-left: 3px solid var(--accent-cyan);
    background: rgba(0, 212, 255, 0.03);
}

.alert-item:hover {
    background: var(--glass-bg-hover);
}

.alert-severity {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.alert-body {
    flex: 1;
    min-width: 0;
}

.alert-message {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.alert-meta {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.alert-actions {
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════
   CHANNEL CARDS
   ═══════════════════════════════════════════ */

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-5);
}

.channel-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.channel-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), var(--shadow-glow-cyan);
}

.channel-banner {
    height: 80px;
    background: var(--accent-gradient);
    position: relative;
    overflow: hidden;
}

.channel-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.channel-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    border: 3px solid var(--bg-secondary);
    position: absolute;
    bottom: -28px;
    left: var(--space-5);
    background: var(--bg-secondary);
    overflow: hidden;
}

.channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-info {
    padding: var(--space-10) var(--space-5) var(--space-5);
}

.channel-name {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.channel-handle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.channel-stats {
    display: flex;
    gap: var(--space-5);
    margin-bottom: var(--space-4);
}

.channel-stat {
    text-align: center;
}

.channel-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.channel-stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.channel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--glass-border);
}

.channel-synced {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.verified-badge {
    color: var(--accent-cyan);
    font-size: 14px;
}


/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--space-5);
    opacity: 0.4;
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.empty-state-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-6);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}


/* ═══════════════════════════════════════════
   FAB (Floating Action Button)
   ═══════════════════════════════════════════ */

.fab {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    z-index: var(--z-dropdown);
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
    transition: all var(--transition-smooth);
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.4);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-smooth);
}

.fab.active .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.fab-menu-item:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}


/* ═══════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Animated Counter ─── */
.counter {
    display: inline-block;
}

/* ─── Fade-in animation ─── */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

.slide-up {
    animation: slideUp 0.5s ease forwards;
}

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