/* ── AetherFlow — Premium Dark Glassmorphism UI ── */

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

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

:root {
    --bg-dark: #070913;
    --bg-surface: #0e1326;
    --accent: #8b5cf6;
    --accent-glow: #a855f7;
    --accent-blue: #6366f1;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
}

/* ── Global Dark Background ── */
html {
    background-color: #070913 !important;
    color: #f8fafc;
    scroll-behavior: smooth;
}

body {
    background-color: #070913 !important;
    background-image: 
        radial-gradient(circle at 50% -10%, rgba(139, 92, 246, 0.28) 0%, transparent 60%),
        radial-gradient(circle at 90% 25%, rgba(99, 102, 241, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 10% 65%, rgba(168, 85, 247, 0.15) 0%, transparent 45%),
        radial-gradient(rgba(139, 92, 246, 0.12) 1.2px, transparent 1.2px) !important;
    background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    color: #f1f5f9;
    margin: 0;
    padding: 0;
}

/* ── Glass surfaces ── */
.glass {
    background: rgba(14, 19, 38, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.glass-card {
    background: rgba(13, 18, 36, 0.9) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.22) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(18, 24, 48, 0.96) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
    transform: translateY(-6px);
    box-shadow: 0 18px 45px rgba(124, 58, 237, 0.25), 0 0 25px rgba(139, 92, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.neon-border {
    border: 1px solid rgba(139, 92, 246, 0.25);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.12), inset 0 0 15px rgba(139, 92, 246, 0.05);
}

/* ── Gradient text ── */
.gradient-text {
    background: linear-gradient(135deg, #c084fc 0%, #a78bfa 40%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-8px); }
}

.animate-float { animation: float 6s ease-in-out infinite; }

/* ── Category badges ── */
.tag-16 {
    background: rgba(168, 85, 247, 0.2) !important;
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    color: #f3e8ff !important;
}
.tag-18 {
    background: rgba(244, 63, 94, 0.2) !important;
    border: 1px solid rgba(244, 63, 94, 0.45) !important;
    color: #ffe4e6 !important;
}
.tag-anime {
    background: rgba(59, 130, 246, 0.2) !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
    color: #dbeafe !important;
}

/* ── Buttons ── */
.btn-primary {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #ffffff !important;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
}
.btn-primary:hover {
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.65);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #8b5cf6, #4f46e5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #ddd6fe !important;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(168, 85, 247, 0.5);
    color: #ffffff !important;
}

/* ── Metric pill ── */
.metric-pill {
    background: rgba(7, 10, 22, 0.95) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    border-radius: 14px;
}

/* ── Package card ── */
.package-card {
    background: rgba(13, 18, 36, 0.9) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.package-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c084fc, #818cf8, transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.package-card:hover::before { opacity: 1; }
.package-card:hover {
    background: rgba(18, 24, 48, 0.96) !important;
    border-color: rgba(168, 85, 247, 0.55) !important;
    transform: translateY(-6px);
    box-shadow: 0 18px 45px rgba(124, 58, 237, 0.25), 0 0 30px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ── Price toggle (segmented control) ── */
.toggle-wrap {
    background: rgba(10, 14, 30, 0.9);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    padding: 4px;
    display: inline-flex;
    gap: 4px;
}
.toggle-btn {
    padding: 8px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #94a3b8;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: transparent;
}
.toggle-btn:hover {
    color: #e2e8f0;
}
.toggle-btn.active {
    background: linear-gradient(135deg, #7c3aed, #6366f1) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

/* ── Filter button ── */
.filter-btn {
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    background: rgba(14, 19, 38, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
}
.filter-btn:hover {
    background: rgba(139, 92, 246, 0.18);
    color: #ffffff;
    border-color: rgba(168, 85, 247, 0.4);
}
.filter-btn.active {
    background: linear-gradient(135deg, #7c3aed, #6366f1) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #070913; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.6); }

/* ── Loading spinner ── */
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error text ── */
.error-text { color: #f87171; }

/* ════════════════════════════════════════════════════════════════════
   ADMIN PANEL / CABINET
   ════════════════════════════════════════════════════════════════════ */

.tabs-bar {
    display: inline-flex;
    gap: 4px;
    background: rgba(10, 14, 30, 0.9);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 14px;
    padding: 4px;
}
.tab-btn {
    padding: 9px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
}
.tab-btn:hover { color: #e2e8f0; }
.tab-btn.active {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.stat-period-btn {
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
}
.stat-period-btn:hover {
    color: #e2e8f0;
}
.stat-period-btn.active {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* ── Admin table ── */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.admin-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    white-space: nowrap;
}
.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    color: #e2e8f0;
    vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(139, 92, 246, 0.06); }

/* ── Inline inputs ── */
.inp {
    background: rgba(8, 12, 26, 0.9) !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    border-radius: 8px;
    padding: 8px 12px;
    color: #f1f5f9 !important;
    font-size: 14px;
    width: 100%;
    transition: all 0.2s;
}
.inp::placeholder { color: #64748b; }
.inp:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.6) !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9 !important;
    -webkit-box-shadow: 0 0 0 1000px #080c1a inset !important;
    caret-color: #f1f5f9;
    transition: background-color 9999s ease-in-out 0s;
}
.inp-sm { width: 110px; }
.inp-num { width: 90px; }

/* ── Toggle switch ── */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    inset: 0;
    background: rgba(100, 116, 139, 0.4);
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}
.switch .slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.switch input:checked + .slider {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
}
.switch input:checked + .slider::before {
    transform: translateX(20px);
}

/* ── Admin buttons ── */
.btn-save {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-save:hover { box-shadow: 0 4px 14px rgba(124,58,237,0.4); transform: translateY(-1px); }

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ghost:hover { background: rgba(139,92,246,0.15); border-color: rgba(168,85,247,0.4); color: #fff; }

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); color: #fff; }

/* ── Bundle card (admin list) ── */
.bundle-row {
    background: rgba(14, 19, 38, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 14px;
    padding: 18px 20px;
    transition: all 0.3s ease;
}
.bundle-row:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(18, 24, 48, 0.95);
}

/* ── Channel checkbox grid ── */
.ch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.ch-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(8, 12, 26, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: #cbd5e1;
}
.ch-check:hover { border-color: rgba(139,92,246,0.35); }
.ch-check input { accent-color: #7c3aed; width: 16px; height: 16px; }
.ch-check.checked {
    background: rgba(139,92,246,0.15);
    border-color: rgba(168,85,247,0.45);
    color: #ffffff;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(10, 14, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139,92,246,0.4);
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.ok  { border-color: rgba(34,197,94,0.5); }
.toast.err { border-color: rgba(239,68,68,0.5); }

/* ── Badge ── */
.badge-on  { background: rgba(34,197,94,0.2); color: #86efac; border: 1px solid rgba(34,197,94,0.4); padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-off { background: rgba(100,116,139,0.2); color: #cbd5e1; border: 1px solid rgba(100,116,139,0.4); padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
