/* ============================================================
   ZPK Digital — Dark Theme (Premium Black)
   Uses html[data-theme="dark"] so page :root blocks cannot override.
   ============================================================ */

/* Instant theme switch — only pause transitions briefly (keep looping animations) */
html.theme-switching,
html.theme-switching * {
    transition: none !important;
}

@keyframes zpkThemeSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.12); }
    100% { transform: rotate(360deg) scale(1); }
}

.theme-toggle.theme-spin {
    animation: zpkThemeSpin 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zpkAmbientPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

@keyframes zpkGlowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.35); }
    70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
}

@keyframes zpkCardShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes zpkBorderGlow {
    0%, 100% { border-color: rgba(99, 102, 241, 0.25); }
    50% { border-color: rgba(56, 189, 248, 0.45); }
}

@keyframes pulseTag {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45); }
    70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

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

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

html[data-theme="dark"] {
    color-scheme: dark;

    /* Brand */
    --primary: #818cf8;
    --secondary: #38bdf8;
    --gradient: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);

    /* Surfaces — never reuse --white for cards */
    --text-dark: #f1f5f9;
    --text-gray: #94a3b8;
    --bg-light: #050505;
    --bg-section: #0c0c0c;
    --white: #ffffff;
    --border-color: rgba(255, 255, 255, 0.08);
    --soft-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);

    /* Header / Footer */
    --f-primary: #818cf8;
    --f-secondary: #38bdf8;
    --f-gradient: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
    --f-text-dark: #f1f5f9;
    --f-text-gray: #94a3b8;
    --f-text-light: #64748b;
    --f-border: rgba(255, 255, 255, 0.08);
    --f-bg-soft: #121212;

    /* Dashboard */
    --primary-hover: #6366f1;
    --primary-light: rgba(99, 102, 241, 0.18);
    --accent: #fbbf24;
    --bg-body: #050505;
    --bg-card: #121212;
    --text-heading: #f1f5f9;
    --text-main: #cbd5e1;
    --text-muted: #64748b;
    --border-soft: #1a1a1a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55);
    --shadow-premium: 0 24px 48px rgba(0, 0, 0, 0.6);
}

/* ========== GLOBAL CANVAS ========== */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background: #050505 !important;
    background-color: #050505 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] body {
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.16), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(14, 165, 233, 0.08), transparent),
        radial-gradient(ellipse 50% 40% at 0% 80%, rgba(168, 85, 247, 0.06), transparent) !important;
    background-attachment: fixed !important;
}

/* Soft ambient glow layer behind content */
html[data-theme="dark"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1), transparent 42%),
        radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.07), transparent 45%);
    animation: zpkAmbientPulse 8s ease-in-out infinite;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #050505;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    border-radius: 10px;
}

/* ========== TYPOGRAPHY (use vars — do not force all h1) ========== */
html[data-theme="dark"] .logo-text,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .hero h1:not(.dynamic-text),
html[data-theme="dark"] .pricing-card h3,
html[data-theme="dark"] .faq-question,
html[data-theme="dark"] .doc-header h1,
html[data-theme="dark"] .doc-section h2,
html[data-theme="dark"] .doc-section h3,
html[data-theme="dark"] .resources-hero h1,
html[data-theme="dark"] .resource-card h3,
html[data-theme="dark"] .psc-info h3,
html[data-theme="dark"] .psc-info .highlight,
html[data-theme="dark"] .nav-section h5,
html[data-theme="dark"] .toc-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .hero p,
html[data-theme="dark"] .section-subtitle,
html[data-theme="dark"] .page-header p,
html[data-theme="dark"] .doc-header p,
html[data-theme="dark"] .doc-section p,
html[data-theme="dark"] .doc-section ul,
html[data-theme="dark"] .doc-section li,
html[data-theme="dark"] .resources-hero p,
html[data-theme="dark"] .resource-card p,
html[data-theme="dark"] .psc-info p,
html[data-theme="dark"] .metric-item p,
html[data-theme="dark"] .faq-answer,
html[data-theme="dark"] .pricing-card li,
html[data-theme="dark"] .pricing-card p,
html[data-theme="dark"] .brand-desc,
html[data-theme="dark"] .nav-list a,
html[data-theme="dark"] .toc-list a {
    color: #94a3b8 !important;
}

/* Keep gradient text working */
html[data-theme="dark"] .dynamic-text,
html[data-theme="dark"] .metric-item h3,
html[data-theme="dark"] .feature-icon,
html[data-theme="dark"] .page-header h1 {
    background: var(--gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

html[data-theme="dark"] .dynamic-text::after {
    -webkit-text-fill-color: #818cf8;
    color: #818cf8;
}

/* ========== HEADER — soft blend into page ========== */
html[data-theme="dark"] header,
html[data-theme="dark"] #mainHeader {
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.92) 0%, rgba(5, 5, 5, 0.55) 70%, rgba(5, 5, 5, 0) 100%) !important;
    border-bottom: 1px solid transparent !important;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: none !important;
}

html[data-theme="dark"] header::after,
html[data-theme="dark"] #mainHeader::after {
    opacity: 1;
    bottom: -36px;
    height: 36px;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.45), transparent) !important;
}

html[data-theme="dark"] header.scrolled,
html[data-theme="dark"] #mainHeader.scrolled {
    background: rgba(5, 5, 5, 0.82) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] header.scrolled::after,
html[data-theme="dark"] #mainHeader.scrolled::after {
    opacity: 0.6;
}

html[data-theme="dark"] .btn-trial {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

html[data-theme="dark"] .header-nav a {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .header-nav a:hover {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .lang-switcher-pill {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
}

html[data-theme="dark"] .lang-switcher-pill a {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .lang-switcher-pill a.active {
    color: #fff !important;
}

html[data-theme="dark"] .btn-login {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .btn-login:hover {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .nav-auth {
    border-left-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .nav-auth a[style*="background"] {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .hamburger span {
    background: #f1f5f9 !important;
}

html[data-theme="dark"] .mobile-menu {
    background: #0a0a0a !important;
    border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .mobile-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .mobile-menu-header,
html[data-theme="dark"] .mobile-menu-footer {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .btn-close-menu {
    background: #1a1a1a !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .mobile-nav-links a {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .mobile-nav-links a:hover {
    background: #121212 !important;
}

html[data-theme="dark"] .btn-login-mobile,
html[data-theme="dark"] .btn-lang-m {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .btn-lang-m.active {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--f-border, rgba(226, 232, 240, 0.6));
    background: var(--f-bg-soft, #f8fafc);
    color: var(--f-text-gray, #475569);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--f-primary, #4f46e5);
    transform: scale(1.06);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

html[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #fbbf24 !important;
}

.mobile-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid var(--f-border, #e2e8f0);
    background: var(--f-bg-soft, #f8fafc);
    color: var(--f-text-gray, #475569);
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
}

html[data-theme="dark"] .mobile-theme-toggle {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #fbbf24 !important;
}

.auth-theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
}

/* ========== HERO / HOME ========== */
html[data-theme="dark"] .hero-wrapper {
    background: transparent !important;
}

html[data-theme="dark"] .tag_highlight {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .tag_highlight .tag_span {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
}

html[data-theme="dark"] .hero-dashboard {
    background: #121212 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .dashboard-header {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    background: #121212 !important;
}

html[data-theme="dark"] .dashboard-content {
    background: #0a0a0a !important;
}

html[data-theme="dark"] .msg-user {
    background: #1e1e1e !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .floating-stat {
    background: #161616 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .floating-stat h4,
html[data-theme="dark"] .floating-stat strong,
html[data-theme="dark"] .floating-stat span {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .floating-stat p {
    color: #94a3b8 !important;
}

/* Metrics */
html[data-theme="dark"] .metrics-banner {
    background: #0c0c0c !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

/* Cards / sections */
html[data-theme="dark"] .step-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .plan-status-card,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .doc-card,
html[data-theme="dark"] .status-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .tip-card,
html[data-theme="dark"] .resource-card,
html[data-theme="dark"] .forum-card,
html[data-theme="dark"] .legal-content,
html[data-theme="dark"] .contact-form,
html[data-theme="dark"] .contact-info-card,
html[data-theme="dark"] .release-item,
html[data-theme="dark"] .security-card,
html[data-theme="dark"] .training-card,
html[data-theme="dark"] .case-card,
html[data-theme="dark"] .blog-card,
html[data-theme="dark"] .tutorial-card,
html[data-theme="dark"] .api-card,
html[data-theme="dark"] .toast-notification,
html[data-theme="dark"] .chat-window {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .feature-card:hover,
html[data-theme="dark"] .step-card:hover,
html[data-theme="dark"] .pricing-card:hover {
    background: #181818 !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

html[data-theme="dark"] .step-icon-box {
    background: #1a1a1a !important;
    color: #818cf8 !important;
}

html[data-theme="dark"] .billing-toggle {
    background: #1a1a1a !important;
}

html[data-theme="dark"] .billing-toggle button {
    color: #64748b !important;
}

html[data-theme="dark"] .billing-toggle button.active {
    background: #262626 !important;
    color: #a5b4fc !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .faq-item.active {
    background: #161628 !important;
}

html[data-theme="dark"] .faq-item.active .faq-question {
    color: #a5b4fc !important;
}

html[data-theme="dark"] .price {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .badge-active {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

html[data-theme="dark"] .btn-white {
    background: #fff !important;
    color: #4f46e5 !important;
}

html[data-theme="dark"] .chat-messages {
    background: #0a0a0a !important;
}

html[data-theme="dark"] .toast-icon {
    background: rgba(16, 185, 129, 0.15) !important;
}

html[data-theme="dark"] .toast-content h4 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .toast-content p {
    color: #94a3b8 !important;
}

/* Kill leftover white/light surfaces from inline/hardcoded styles */
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f1f5f9"],
html[data-theme="dark"] [style*="background:#f1f5f9"] {
    background: #121212 !important;
}

html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#0f172a"],
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color:#1e293b"] {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] section {
    background: transparent;
}

/* ========== FOOTER ========== */
html[data-theme="dark"] .main-footer {
    background: #050505 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .footer-col h4 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .footer-col a,
html[data-theme="dark"] .legal-item {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .social-links a {
    background: #1a1a1a !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .social-links a:hover {
    background: #6366f1 !important;
    color: #fff !important;
}

html[data-theme="dark"] .footer-divider {
    background: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .footer-copy p,
html[data-theme="dark"] .footer-bottom [style*="color: #64748b"] {
    color: #64748b !important;
}

html[data-theme="dark"] .footer-bottom [style*="background: #e2e8f0"] {
    background: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] .footer-bottom img[style*="grayscale"] {
    filter: grayscale(100%) brightness(1.8) !important;
}

/* ========== AUTH ========== */
html[data-theme="dark"] body:has(.auth-container) {
    background: linear-gradient(-45deg, #050505, #0f172a, #1e1b4b, #0c4a6e) !important;
    background-size: 400% 400% !important;
    animation: zpkCardShimmer 18s ease infinite !important;
}

html[data-theme="dark"] .auth-container {
    background: rgba(18, 18, 18, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.65), 0 0 40px rgba(99, 102, 241, 0.12) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .decor-item {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(99, 102, 241, 0.15) !important;
}

html[data-theme="dark"] .auth-container .logo,
html[data-theme="dark"] .auth-container h1,
html[data-theme="dark"] .auth-container .subtitle {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .auth-container label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .auth-footer {
    color: #64748b !important;
}

html[data-theme="dark"] .decor-item {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #525252 !important;
}

html[data-theme="dark"] .divider span {
    background: #121212 !important;
    color: #64748b !important;
}

html[data-theme="dark"] .social-btn {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

/* ========== DOCS / CONTENT ========== */
html[data-theme="dark"] .sidebar-docs,
html[data-theme="dark"] .docs-sidebar,
html[data-theme="dark"] .toc-sidebar {
    background: #0c0c0c !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] code,
html[data-theme="dark"] pre {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] table th {
    background: #1a1a1a !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] table td {
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: #cbd5e1 !important;
}

/* ========== DASHBOARD ========== */
html[data-theme="dark"] .sidebar {
    background: #0a0a0a !important;
    border-right-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .workspace-switcher,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .dash-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .agent-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .preview-card,
html[data-theme="dark"] .inbox-item,
html[data-theme="dark"] .inbox-layout,
html[data-theme="dark"] .inbox-sidebar,
html[data-theme="dark"] .inbox-main,
html[data-theme="dark"] .inbox-chat-header,
html[data-theme="dark"] .chat-footer,
html[data-theme="dark"] .chat-panel,
html[data-theme="dark"] .kb-card,
html[data-theme="dark"] .analytics-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .widget-preview,
html[data-theme="dark"] .user-profile,
html[data-theme="dark"] .settings-panel,
html[data-theme="dark"] .form-box,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .table-container,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .popup-card,
html[data-theme="dark"] .model-card,
html[data-theme="dark"] #wsDropdown,
html[data-theme="dark"] #notifDropdown {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .inbox-main,
html[data-theme="dark"] .agent-filters,
html[data-theme="dark"] .ac-metrics,
html[data-theme="dark"] .search-wrapper,
html[data-theme="dark"] .chat-input {
    background: #1a1a1a !important;
}

html[data-theme="dark"] .conv-title,
html[data-theme="dark"] .user-details h4,
html[data-theme="dark"] .inbox-sidebar-header h2,
html[data-theme="dark"] .page-title h1 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .conv-preview,
html[data-theme="dark"] .conv-time,
html[data-theme="dark"] .user-details p,
html[data-theme="dark"] .inbox-empty p {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .topbar {
    background: rgba(10, 10, 10, 0.92) !important;
    backdrop-filter: blur(20px);
}

html[data-theme="dark"] .search-box {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .search-box input {
    color: #f1f5f9 !important;
    background: transparent !important;
}

html[data-theme="dark"] .search-results,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] #notifDropdown {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.active {
    background: rgba(99, 102, 241, 0.14) !important;
}

html[data-theme="dark"] .icon-btn {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-outline {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .progress-bar {
    background: #1a1a1a !important;
}

html[data-theme="dark"] .sidebar-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* ========== DOCS ========== */
html[data-theme="dark"] .docs-layout {
    background: transparent !important;
}
html[data-theme="dark"] .docs-nav,
html[data-theme="dark"] .docs-toc,
html[data-theme="dark"] .docs-content {
    background: transparent !important;
}
html[data-theme="dark"] .docs-nav .nav-list a:hover,
html[data-theme="dark"] .docs-nav .nav-list a.active {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
}
html[data-theme="dark"] .alert-info {
    background: rgba(14, 165, 233, 0.1) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    color: #7dd3fc !important;
}
html[data-theme="dark"] .alert-tip {
    background: rgba(139, 92, 246, 0.12) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    color: #c4b5fd !important;
}
html[data-theme="dark"] .alert strong,
html[data-theme="dark"] .doc-section strong {
    color: #f1f5f9 !important;
}

/* ========== RESOURCES ========== */
html[data-theme="dark"] .resources-hero {
    background: transparent !important;
}
html[data-theme="dark"] .resource-card {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] .category-tag {
    background: #1a1a1a !important;
    color: #94a3b8 !important;
}
html[data-theme="dark"] .card-link {
    color: #a5b4fc !important;
}

/* ========== PRICING ========== */
html[data-theme="dark"] .plan-status-card {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] .guest-info-banner {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .billing-toggle {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] .billing-toggle button {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .billing-toggle button.active {
    background: #262626 !important;
    color: #a5b4fc !important;
}

/* ========== MISC PAGES ========== */
html[data-theme="dark"] .hero {
    background: transparent !important;
}

html[data-theme="dark"] nav {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .badge {
    background: #1a1a1a !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .redirect-card h1 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .redirect-card p,
html[data-theme="dark"] .secure-footer {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .spinner {
    border-color: #1a1a1a !important;
    border-top-color: #818cf8 !important;
}

/* Buttons with gradient keep white text */
html[data-theme="dark"] .btn-main,
html[data-theme="dark"] .btn-trial,
html[data-theme="dark"] .btn-trial-mobile,
html[data-theme="dark"] .pricing-btn.primary,
html[data-theme="dark"] .msg-ai {
    color: #ffffff !important;
}

/* ========== CATCH-ALL SURFACES ========== */
html[data-theme="dark"] .story-section,
html[data-theme="dark"] .value-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .panel-box,
html[data-theme="dark"] .checkout-wrapper .card,
html[data-theme="dark"] .plan-hero,
html[data-theme="dark"] .checkout-wrapper .feature-item,
html[data-theme="dark"] .view-all-agents-bar,
html[data-theme="dark"] .agent-overview-row,
html[data-theme="dark"] .btn-manage-agent,
html[data-theme="dark"] .widget-sim-area {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .view-all-agents-bar a,
html[data-theme="dark"] .btn-manage-agent {
    color: #a5b4fc !important;
}

html[data-theme="dark"] .btn-manage-agent {
    color: #f1f5f9 !important;
    background: #1a1a1a !important;
}

html[data-theme="dark"] .checkout-wrapper h1,
html[data-theme="dark"] .checkout-wrapper h3,
html[data-theme="dark"] .checkout-wrapper h4,
html[data-theme="dark"] .checkout-wrapper h5,
html[data-theme="dark"] .plan-name,
html[data-theme="dark"] .plan-price,
html[data-theme="dark"] .total-row {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .checkout-wrapper p,
html[data-theme="dark"] .summary-row,
html[data-theme="dark"] .currency-note,
html[data-theme="dark"] .checkout-wrapper .feature-item {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .checkout-wrapper .btn,
html[data-theme="dark"] .checkout-wrapper .btn-bank,
html[data-theme="dark"] .checkout-wrapper .btn-primary {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    padding: 18px 20px !important;
}

html[data-theme="dark"] .checkout-wrapper .btn-primary {
    border: 1px solid transparent !important;
    color: #fff !important;
}

html[data-theme="dark"] .checkout-wrapper .btn-bank {
    background: #0a0a0a !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"] .important-box {
    background: rgba(239, 68, 68, 0.12) !important;
    border-left-color: #ef4444 !important;
    color: #fecaca !important;
}

html[data-theme="dark"] .important-box strong {
    color: #fca5a5 !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .custom-select {
    background-color: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .page-header {
    background: transparent !important;
}

html[data-theme="dark"] .page-header p {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .about-text h2,
html[data-theme="dark"] .section-title h2,
html[data-theme="dark"] .value-card h3 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .about-text p,
html[data-theme="dark"] .value-card p,
html[data-theme="dark"] .section-title p {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .about-image {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Legal / footer pages (privacy, tos, refund) */
html[data-theme="dark"] .layout > .sidebar,
html[data-theme="dark"] .layout > .content,
html[data-theme="dark"] .layout > aside.sidebar,
html[data-theme="dark"] .layout > main.content {
    background: #121212 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .layout > .content h2,
html[data-theme="dark"] .layout > main.content h2,
html[data-theme="dark"] .layout > .sidebar h4 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .layout > .content p,
html[data-theme="dark"] .layout > main.content p,
html[data-theme="dark"] .layout > .content strong,
html[data-theme="dark"] .layout .toc-list a {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .layout .toc-list a:hover {
    color: #f1f5f9 !important;
}

/* ========== MOTION / EFFECTS (dark) ========== */
html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .panel-box:hover {
    border-color: rgba(99, 102, 241, 0.35) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(99, 102, 241, 0.1) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}

html[data-theme="dark"] .stat-card:hover {
    transform: translateY(-4px);
}

html[data-theme="dark"] .tag_highlight {
    animation: pulseTag 2.4s ease-out infinite !important;
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.18);
}

html[data-theme="dark"] .floating-stat {
    animation: float 4s ease-in-out infinite !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55), 0 0 28px rgba(56, 189, 248, 0.12) !important;
}

html[data-theme="dark"] .stat-circle {
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

html[data-theme="dark"] .hero-dashboard {
    animation: zpkHeroGlow 5s ease-in-out infinite;
}

@keyframes zpkHeroGlow {
    0%, 100% { box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.15), 0 0 40px rgba(99, 102, 241, 0.08); }
    50% { box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(56, 189, 248, 0.35), 0 0 55px rgba(56, 189, 248, 0.16); }
}

html[data-theme="dark"] .btn-main,
html[data-theme="dark"] .pricing-btn.primary,
html[data-theme="dark"] .btn-trial {
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35) !important;
    transition: transform 0.35s ease, box-shadow 0.35s ease !important;
}

html[data-theme="dark"] .btn-main:hover,
html[data-theme="dark"] .pricing-btn.primary:hover,
html[data-theme="dark"] .btn-trial:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(56, 189, 248, 0.4) !important;
}

html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .step-card,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .value-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease !important;
}

html[data-theme="dark"] .feature-card:hover,
html[data-theme="dark"] .step-card:hover,
html[data-theme="dark"] .pricing-card:hover,
html[data-theme="dark"] .value-card:hover {
    border-color: rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.2), 0 0 40px rgba(99, 102, 241, 0.12) !important;
}

html[data-theme="dark"] .step-card:hover .step-icon-box,
html[data-theme="dark"] .feature-card:hover .feature-icon {
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.45));
}

html[data-theme="dark"] .metric-item h3 {
    filter: drop-shadow(0 0 18px rgba(99, 102, 241, 0.25));
}

html[data-theme="dark"] .pricing-card.popular {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(99, 102, 241, 0.35), 0 0 48px rgba(99, 102, 241, 0.15) !important;
}

html[data-theme="dark"] .cta-banner {
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.18) !important;
}

html[data-theme="dark"] #particles-canvas {
    opacity: 0.85;
}

html[data-theme="dark"] .tips-hero,
html[data-theme="dark"] .security-hero,
html[data-theme="dark"] .help-hero {
    background: radial-gradient(ellipse 70% 55% at 50% -12%, rgba(99, 102, 241, 0.12), transparent 55%),
                linear-gradient(to bottom, #050505 0%, #0a0a0a 100%) !important;
}

html[data-theme="dark"] .security-hero {
    background: radial-gradient(ellipse 70% 55% at 50% -15%, rgba(16, 185, 129, 0.12), transparent 55%),
                linear-gradient(to bottom, #050505 0%, #0a0a0a 100%) !important;
}

html[data-theme="dark"] .chat-msg {
    animation: slideInMsg 0.55s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="dark"] body::before,
    html[data-theme="dark"] .tag_highlight,
    html[data-theme="dark"] .floating-stat,
    html[data-theme="dark"] .hero-dashboard,
    html[data-theme="dark"] body:has(.auth-container),
    html[data-theme="dark"] .decor-item {
        animation: none !important;
    }
}
