/* public/assets/css/style.css - Tumche.com Next-Gen Superapp Design System */

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

:root {
    --bg-dark: #070a11;
    --bg-surface: #0e1422;
    --bg-card: rgba(18, 26, 44, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.09);
    --border-glass-glow: rgba(59, 130, 246, 0.4);
    
    /* Vibrant Color Palette */
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Shadows & Radii */
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-pill: 9999px;
    --shadow-glass: 0 10px 30px 0 rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);
}

/* Light Theme Support */
body.theme-light {
    --bg-dark: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(0, 0, 0, 0.04);
    --bg-glass-hover: rgba(0, 0, 0, 0.08);
    --border-glass: rgba(0, 0, 0, 0.09);
    --border-glass-glow: rgba(59, 130, 246, 0.3);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --shadow-glass: 0 10px 30px 0 rgba(0, 0, 0, 0.08);
}

/* Reset & Global Baseline */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Outfit', 'Inter', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
}

body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #60a5fa;
}

/* Glassmorphism Cards */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-glass:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.5), var(--shadow-glow);
}

/* Animated Breaking News Ticker Tape */
.ticker-wrap {
    width: 100%;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2), rgba(139, 92, 246, 0.2));
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    overflow: hidden;
}

.ticker-badge {
    background: var(--accent-red);
    color: white;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    letter-spacing: 0.5px;
    animation: pulse-red 2s infinite;
}

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

.ticker-text {
    color: var(--text-primary);
    white-space: nowrap;
    animation: ticker 30s linear infinite;
    font-weight: 500;
}

/* Layout System */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-glass);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 24px;
    color: white;
    box-shadow: var(--shadow-glow);
}

.brand-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    display: block;
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-left: 3px solid var(--primary);
}

.main-content {
    flex: 1;
    padding: 24px 36px;
}

/* Header & Omnibox Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.omnibox-search {
    position: relative;
    flex: 1;
    max-width: 650px;
}

.omnibox-search input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.omnibox-search input:focus {
    background: var(--bg-glass-hover);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.omnibox-search i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.top-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.select-pill {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    outline: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.select-pill:hover {
    background: var(--bg-glass-hover);
    border-color: var(--primary);
}

/* Category Quick Launcher Ribbon */
.launcher-ribbon {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 28px;
    scrollbar-width: none;
}

.launcher-chip {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.launcher-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Widgets Matrix Grid */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }

@media (max-width: 1024px) {
    .col-8, .col-6, .col-4 { grid-column: span 12; }
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
}

/* Custom UI Badges */
.badge {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-primary   { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-success   { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-info      { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-danger    { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-secondary { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Buttons */
.btn {
    padding: 10px 22px;
    border-radius: var(--radius-lg);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-primary   { background: var(--primary-gradient); color: white; box-shadow: var(--shadow-glow); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); }
.btn-secondary:hover { background: var(--bg-glass-hover); }
.btn-success   { background: var(--accent-emerald); color: white; }
.btn-danger    { background: var(--accent-red); color: white; }
.btn-sm        { padding: 7px 14px; font-size: 12px; }

/* Persistent Mini Audio/Video Sticky Player Bar */
.sticky-mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    z-index: 9999;
}

.sticky-mini-player .player-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Floating AI Superapp Assistant Chatbot Button & Window */
.ai-fab-btn {
    position: fixed;
    bottom: 80px;
    right: 28px;
    background: var(--primary-gradient);
    color: white;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
    font-weight: 700;
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-fab-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.6);
}

.ai-chat-window {
    position: fixed;
    bottom: 145px;
    right: 28px;
    width: 380px;
    height: 520px;
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-header {
    background: var(--bg-glass);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-chat-msg {
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
}

.ai-chat-msg.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-chat-msg.bot {
    background: var(--bg-glass);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-glass);
}

.ai-chat-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 8px;
}

.ai-chat-footer input {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 8px 14px;
    color: var(--text-primary);
    outline: none;
    font-size: 13px;
}

/* Accessibility & High Contrast Modes */
body.font-size-lg {
    font-size: 18px !important;
}

body.font-size-xl {
    font-size: 21px !important;
}

body.high-contrast-mode {
    --bg-dark: #000000 !important;
    --bg-surface: #000000 !important;
    --bg-card: #000000 !important;
    --border-glass: #ffffff !important;
    --text-primary: #ffffff !important;
    --text-secondary: #ffff00 !important;
    --primary: #00ffff !important;
}


/* ============================================================
   Superapp Launcher Pattern — Wallet Strip, Promo Banner,
   Categorized Icon Grid, Bottom Tab Bar
   ============================================================ */

.wallet-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-glow);
}

.wallet-strip-balance {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.wallet-strip-balance i {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.wallet-strip-label {
    display: block;
    font-size: 12px;
    opacity: 0.85;
}

.wallet-strip-amount {
    display: block;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.promo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 20px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.promo-banner:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
}

.promo-banner-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    flex-shrink: 0;
}

.promo-banner-title {
    color: var(--text-primary);
    font-weight: 500;
}

.module-section {
    margin-bottom: 24px;
}

.module-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 14px;
}

.module-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 6px 2px;
    border-radius: var(--radius-md);
    transition: transform 0.15s ease, background 0.15s ease;
}

.module-tile:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
}

.module-tile-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-tile-icon i {
    width: 24px;
    height: 24px;
}

.module-tile-label {
    font-size: 11.5px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.25;
}

/* Bottom Tab Bar — mobile-first navigation, hidden on desktop widths */
.bottom-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-glass);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
}

.bottom-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10.5px;
    padding: 4px 10px;
}

.bottom-tab-item i {
    width: 20px;
    height: 20px;
}

.bottom-tab-item.active {
    color: var(--primary);
}

@media (max-width: 860px) {
    .bottom-tab-bar {
        display: flex;
    }
    .sidebar {
        display: none;
    }
    .main-content {
        padding-bottom: 76px;
    }
    .module-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
