* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --bg: #000;
    --bg-2: #1c1c1e;
    --bg-3: #2c2c2e;
    --card: rgba(28,28,30,0.7);
    --text: #fff;
    --text-2: #8e8e93;
    --border: rgba(255,255,255,0.08);
    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --c-blue: #0a84ff;
    --c-purple: #bf5af2;
    --c-red: #ff453a;
    --c-orange: #ff9f0a;
    --c-green: #30d158;
    --c-teal: #64d2ff;
    --c-yellow: #ffd60a;
    --c-pink: #ff375f;
    --c-indigo: #5e5ce6;
}

[data-theme="light"] {
    --bg: #f2f2f7;
    --bg-2: #fff;
    --bg-3: #e5e5ea;
    --card: rgba(255,255,255,0.8);
    --text: #000;
    --text-2: #8e8e93;
    --border: rgba(0,0,0,0.06);
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, 'SF Pro Display', 'Vazirmatn', 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    transition: background 0.4s, color 0.4s;
    overscroll-behavior: none;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 0%, rgba(10,132,255,0.15), transparent 50%),
                radial-gradient(circle at 80% 100%, rgba(191,90,242,0.15), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] body::before {
    background: radial-gradient(circle at 20% 0%, rgba(10,132,255,0.08), transparent 50%),
                radial-gradient(circle at 80% 100%, rgba(191,90,242,0.08), transparent 50%);
}

#app {
    position: relative;
    z-index: 1;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 24px;
}

.header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text), var(--text-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
    backdrop-filter: blur(20px);
}

.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 22px; height: 22px; }

.hero-card {
    background: linear-gradient(135deg, rgba(10,132,255,0.2), rgba(191,90,242,0.2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s;
}

.hero-card h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.hero-card p {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 18px;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat {
    background: rgba(255,255,255,0.06);
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

[data-theme="light"] .stat {
    background: rgba(0,0,0,0.04);
}

.stat-label {
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.menu-item {
    background: var(--card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s backwards;
}

.menu-item::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background: linear-gradient(135deg, var(--item-color), transparent);
    transition: opacity 0.3s;
}

.menu-item:active {
    transform: scale(0.94);
}

.menu-item .icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--item-color), var(--item-color-2));
    color: white;
    box-shadow: 0 4px 16px var(--item-shadow);
    position: relative;
    z-index: 1;
}

.menu-item .icon svg { width: 28px; height: 28px; }

.menu-item .title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    position: relative;
    z-index: 1;
}

.menu-item .desc {
    font-size: 12px;
    color: var(--text-2);
    position: relative;
    z-index: 1;
    margin-top: -8px;
}

.list-item {
    background: var(--card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    animation: fadeInUp 0.3s backwards;
}

.list-item:active {
    background: var(--bg-3);
    transform: scale(0.98);
}

.list-item .arrow {
    color: var(--text-2);
    width: 20px;
    height: 20px;
}

.content-box {
    background: var(--card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 24px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 15px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: fadeIn 0.4s;
}

.content-box b { font-weight: 800; color: var(--c-blue); }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    color: var(--c-blue);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s;
    font-family: inherit;
}

.back-btn:active { transform: scale(0.95); }
.back-btn svg { width: 18px; height: 18px; }

.search-bar {
    width: 100%;
    background: var(--card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    color: var(--text);
    font-size: 16px;
    margin-bottom: 16px;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
}

.search-bar:focus {
    border-color: var(--c-blue);
    box-shadow: 0 0 0 4px rgba(10,132,255,0.15);
}

.search-bar::placeholder { color: var(--text-2); }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    backdrop-filter: blur(30px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 14px;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.2s;
    border-radius: 12px;
}

.nav-item:active { transform: scale(0.9); }
.nav-item svg { width: 24px; height: 24px; transition: all 0.2s; }
.nav-item.active { color: var(--c-blue); }
.nav-item.active svg { transform: scale(1.1); }

.section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.loader {
    display: flex;
    justify-content: center;
    padding: 60px;
}

.loader svg {
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    color: var(--c-blue);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    backdrop-filter: blur(20px);
    color: var(--text);
    padding: 14px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2000;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}