/* ==========================================================================
   Meraintkhab Micro-Task - Master Universal Stylesheet
   Auth Animations, 3D Dashboard Cards, Admin Controls & Urdu Nastaliq
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');

/* --- 1. Dynamic Themes & CSS Variables --- */
:root,
body.theme-slate {
    --theme-bg: #090d16;
    --theme-card: #0f172a;
    --theme-border: rgba(51, 65, 85, 0.65);
    --theme-accent: #f59e0b;
    --theme-accent-hover: #d97706;
    --theme-text-muted: #94a3b8;
    --primary-glow: rgba(245, 158, 11, 0.28);
    --card-surface: #0f172a;
    --surface-glass: rgba(15, 23, 42, 0.85);
}

body.theme-emerald {
    --theme-bg: #051410;
    --theme-card: #062b24;
    --theme-border: rgba(16, 185, 129, 0.35);
    --theme-accent: #10b981;
    --theme-accent-hover: #059669;
    --theme-text-muted: #a7f3d0;
    --primary-glow: rgba(16, 185, 129, 0.3);
    --card-surface: #062b24;
    --surface-glass: rgba(6, 43, 36, 0.85);
}

body.theme-violet {
    --theme-bg: #0d091a;
    --theme-card: #1c133a;
    --theme-border: rgba(139, 92, 246, 0.35);
    --theme-accent: #a855f7;
    --theme-accent-hover: #9333ea;
    --theme-text-muted: #ddd6fe;
    --primary-glow: rgba(168, 85, 247, 0.3);
    --card-surface: #1c133a;
    --surface-glass: rgba(28, 19, 58, 0.85);
}

/* --- 2. Global Reset & Animations Keyframes --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--theme-bg) !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: #f8fafc !important;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Urdu Typography Engine */
[dir="rtl"], 
h2, 
h3, 
h4, 
p:lang(ur),
#admin-warning-text,
#welcome-guide-modal {
    font-family: 'Noto Nastaliq Urdu', 'Plus Jakarta Sans', serif;
}

h2, h3 {
    line-height: 1.6 !important;
}

/* Keyframe Animations */
@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.08); }
}

@keyframes borderGlowPulse {
    0%, 100% { border-color: rgba(245, 158, 11, 0.3); }
    50% { border-color: rgba(245, 158, 11, 0.8); box-shadow: 0 0 25px rgba(245, 158, 11, 0.35); }
}

@keyframes formSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- 3. AUTH PAGE (AMAZING ANIMATION & GLASS CARDS) --- */
body.selection\:bg-amber-500:has(#login-form) {
    background: radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.12) 0%, transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(79, 70, 229, 0.12) 0%, transparent 45%),
                #090d16 !important;
}

.fixed.blur-3xl {
    animation: pulseGlow 8s ease-in-out infinite alternate !important;
}

div:has(> #login-form) {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 35px -5px var(--primary-glow) !important;
    animation: cardFloat 6s ease-in-out infinite, formSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

div:has(> #login-form):hover {
    border-color: rgba(245, 158, 11, 0.55) !important;
}

.grid.grid-cols-2:has(#toggle-login) {
    background: rgba(2, 6, 23, 0.9) !important;
    border: 1px solid var(--theme-border) !important;
    padding: 5px !important;
}

#toggle-login, #toggle-signup {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

form input {
    background: rgba(2, 6, 23, 0.75) !important;
    border: 1px solid rgba(51, 65, 85, 0.8) !important;
    color: #ffffff !important;
    transition: all 0.25s ease !important;
}

form input:focus {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    outline: none !important;
}

/* --- 4. DASHBOARD & ADMIN CARDS --- */
nav, header {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid var(--theme-border) !important;
}

.grid > div.bg-theme-card,
.admin-tab-content,
.user-tab-content > div.bg-theme-card {
    background: var(--card-surface) !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: 18px !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.25) !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.grid.grid-cols-2 > div.bg-theme-card:hover,
.grid.sm\:grid-cols-4 > div.bg-theme-card:hover {
    transform: translateY(-5px) scale(1.015) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    box-shadow: 0 15px 30px -8px rgba(0, 0, 0, 0.5), 0 0 20px -3px var(--primary-glow) !important;
}

.grid > div.bg-theme-card::before,
.admin-tab-content::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, #f59e0b, #10b981, #6366f1) !important;
    opacity: 0.15 !important;
    transition: opacity 0.3s ease !important;
}

.grid > div.bg-theme-card:hover::before,
.admin-tab-content:hover::before {
    opacity: 1 !important;
}

/* --- 5. TABS & NAVIGATION BUTTONS --- */
.user-tab-btn, .admin-tab-btn {
    border-radius: 12px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    border: 1px solid transparent;
}

.user-tab-btn.bg-theme-accent, 
.admin-tab-btn.bg-theme-accent {
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-hover) 100%) !important;
    color: #020617 !important;
    box-shadow: 0 4px 18px var(--primary-glow) !important;
    font-weight: 800 !important;
    transform: translateY(-1px);
}

.user-tab-btn:not(.bg-theme-accent):hover,
.admin-tab-btn:not(.bg-theme-accent):hover {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #ffffff !important;
    border-color: rgba(51, 65, 85, 0.8);
    transform: translateY(-1px);
}

/* --- 6. BUTTONS & ACTIONS --- */
button, a.inline-flex {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

button.bg-theme-accent, 
a.bg-theme-accent, 
button[id*="submit"], 
#login-submit-btn, 
#signup-submit-btn {
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-hover) 100%) !important;
    color: #020617 !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px var(--primary-glow) !important;
    border: none !important;
}

button.bg-theme-accent:hover, 
button[id*="submit"]:hover {
    transform: translateY(-2px) scale(1.01) !important;
    box-shadow: 0 8px 25px var(--primary-glow) !important;
    filter: brightness(1.05);
}

#user-logout-btn, #admin-logout-btn, .text-red-400 {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-radius: 10px !important;
    color: #f87171 !important;
}

#user-logout-btn:hover, #admin-logout-btn:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35) !important;
}

/* --- 7. TIKTOK SNAP SLIDER --- */
.snap-mandatory > div {
    transition: transform 0.3s ease, border-color 0.3s ease !important;
}
.snap-mandatory > div:hover {
    transform: translateY(-4px) scale(1.02) !important;
    border-color: var(--theme-accent) !important;
}

/* --- 8. LIVE PAYOUT POPUP --- */
#live-payout-toast {
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
#live-payout-toast.payout-popup-active {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
}
#live-payout-toast.payout-popup-enter {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    visibility: hidden !important;
}
#live-payout-toast > div {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(16, 185, 129, 0.45) !important;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(16, 185, 129, 0.25) !important;
}

/* --- 9. MODALS --- */
#welcome-guide-modal > div,
#task-modal > div,
#store-modal > div,
#account-suspended-screen > div {
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--theme-accent) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 30px var(--primary-glow) !important;
    animation: formSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ==========================================================================
   --- 10. DYNAMIC THEMES LAYOUT ENGINES (1, 2, 3) ---
   ========================================================================== */

/* Universal Announcement Picture Slider Container */
#announcement-slider-box {
    display: none;
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--theme-border);
    background: var(--theme-card);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.25rem;
}

#announcement-slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}

.announcement-slide {
    min-width: 100%;
    position: relative;
}

.announcement-slide img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}
@media (min-width: 640px) {
    .announcement-slide img { height: 210px; }
}

/* Desktop Top Horizontal Nav Tabs Container */
#theme-top-desktop-nav {
    display: none;
}

/* Custom Dropdown Switcher Container */
#theme-dropdown-container {
    display: none;
}

/* -------------------------------------------------------------
   THEME 1: body.theme-slate (App Style - Bottom Nav)
   ------------------------------------------------------------- */
body.theme-slate #dashboard-bottom-bar {
    display: block !important;
}
body.theme-slate {
    padding-bottom: 6rem !important;
}
body.theme-slate #announcement-slider-box {
    display: none !important;
}

/* -------------------------------------------------------------
   THEME 2: body.theme-violet (Top Nav + Announcement Picture Slider)
   ------------------------------------------------------------- */
body.theme-violet #dashboard-bottom-bar {
    display: none !important;
}
body.theme-violet {
    padding-bottom: 2rem !important;
}
body.theme-violet #announcement-slider-box {
    display: block !important;
}
body.theme-violet #theme-top-desktop-nav {
    display: flex !important;
}

/* -------------------------------------------------------------
   THEME 3: body.theme-emerald (Dropdown Selection Nav + Announcement Slider)
   ------------------------------------------------------------- */
body.theme-emerald #dashboard-bottom-bar {
    display: none !important;
}
body.theme-emerald {
    padding-bottom: 2rem !important;
}
body.theme-emerald #announcement-slider-box {
    display: block !important;
}
body.theme-emerald #theme-dropdown-container {
    display: block !important;
}