/* ============================
   EasyService — AI Premium Store
   YTCortiez-style Mini App
   ============================ */

@font-face {
    font-family: 'Apple Color Emoji';
    src: url('../fonts/ios-emoji.ttf') format('truetype');
}

:root {
    --bg: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-card-hover: #242424;
    --bg-elevated: #141414;
    --bg-input: #1e1e1e;
    --bg-tab: #1a1a2e;
    --bg-tab-active: #3b5bdb;

    --text: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #666;

    --accent: #3b5bdb;
    --accent-light: #5c7cfa;
    --green: #10b981;
    --red: #ef4444;
    --orange: #f59e0b;
    --cyan: #22d3ee;
    --purple: #8b5cf6;

    --border: rgba(255,255,255,0.06);
    --border-active: rgba(59,91,219,0.5);

    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;

    --header-h: 52px;
    --nav-h: 64px;

    --transition: all 0.2s ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Apple Color Emoji', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
body.has-custom-bg {
    background-image: linear-gradient(rgba(10, 10, 10, 0.55), rgba(10, 10, 10, 0.55)), var(--app-bg-image);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}
[data-theme="light"] body.has-custom-bg {
    background-image: linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45)), var(--app-bg-image);
}

input, textarea, button { font-family: inherit; border: none; outline: none; background: none; color: inherit; }
button { cursor: pointer; user-select: none; }
img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* ============== Loading ============== */
.loading-screen {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s, visibility 0.4s;
}
.loading-screen.fade-out { opacity: 0; visibility: hidden; }
.loading-content { text-align: center; }
.loading-logo {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 24px;
}
.loading-fire { font-size: 36px; animation: pulse-fire 1s infinite; }
.loading-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 28px; font-weight: 800;
    color: var(--text);
}
.loading-bar {
    width: 120px; height: 3px;
    background: var(--bg-card);
    border-radius: 2px; margin: 0 auto;
    overflow: hidden;
}
.loading-bar-fill {
    width: 30%; height: 100%;
    background: var(--accent);
    border-radius: 2px;
    animation: loading-bar 1s ease infinite;
}

/* ============== App ============== */
.app {
    min-height: 100vh;
    padding-top: var(--header-h);
    padding-bottom: var(--nav-h);
}

/* ============== Header ============== */
.header {
    position: fixed; top: 0; left: 0;
    width: 100%; height: var(--header-h);
    background: rgba(13,13,13,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}
.header-brand {
    display: flex; align-items: center; gap: 8px;
}
.brand-fire { font-size: 22px; }
.brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 18px; font-weight: 800;
    color: var(--text);
}
.header-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; color: var(--text-secondary);
    transition: var(--transition);
}
.header-btn:active { background: var(--bg-card); transform: scale(0.9); }

/* ============== Brand Card ============== */
.brand-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; margin: 12px 16px 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.brand-info {
    display: flex; align-items: center; gap: 12px;
}
.brand-logo {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px; font-weight: 800;
}
.brand-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    border: 2px solid var(--border);
}

/* ============== Tab Bar ============== */
.tab-bar {
    display: flex; gap: 8px;
    padding: 12px 16px 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
    flex-shrink: 0;
    padding: 10px 20px;
    border-radius: 24px;
    background: #111;
    border: 2px solid #222;
    font-size: 14px; font-weight: 700;
    color: #fff;
    transition: var(--transition);
    white-space: nowrap;
    display: flex; align-items: center; gap: 8px;
}
.tab svg {
    color: #fff;
}
.tab:active { transform: scale(0.95); }
.tab.active {
    background: #1a1a1a;
    border-color: #333;
    color: #fff;
}

/* ============== Banner Slider ============== */
.banner-slider {
    margin: 16px; position: relative;
    border-radius: var(--radius); overflow: hidden;
}
.banner-track { position: relative; height: 180px; }
.banner-slide {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity 0.5s ease;
}
.banner-slide.active { opacity: 1; }
.banner-img {
    width: 100%; height: 100%;
    border-radius: var(--radius);
    overflow: hidden; position: relative;
}
.banner-overlay {
    position: absolute; inset: 0;
    padding: 24px;
    display: flex; flex-direction: column; justify-content: center;
}
.banner-money { font-size: 36px; margin-bottom: 8px; }
.banner-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px; font-weight: 800;
    color: white; margin-bottom: 4px;
}
.banner-desc { font-size: 13px; color: rgba(255,255,255,0.7); }
.banner-dots {
    display: flex; justify-content: center; gap: 6px;
    position: absolute; bottom: 10px; width: 100%; z-index: 2;
}
.banner-dot {
    width: 8px; height: 8px; border-radius: 4px;
    background: rgba(255,255,255,0.3);
    transition: var(--transition);
}
.banner-dot.active { width: 20px; background: white; }

/* ============== Sections ============== */
.section { padding: 20px 16px 0; }
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-title-wrap { display: flex; align-items: center; gap: 10px; }
.section-icon { font-size: 22px; }
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px; font-weight: 700;
}
.section-count {
    font-size: 14px; font-weight: 600;
    color: var(--text-secondary);
}

/* ============== Services Grid ============== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 12px;
}

.service-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.service-item:active { transform: scale(0.92); }

.service-icon-wrap {
    width: 64px; height: 64px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.service-icon-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

.service-icon-wrap .icon-emoji {
    font-size: 32px;
}

.service-name {
    font-size: 11px; font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stock badge */
.service-stock {
    position: absolute; top: -4px; right: -4px;
    background: var(--green);
    color: white;
    font-size: 8px; font-weight: 700;
    padding: 2px 5px;
    border-radius: 6px;
    line-height: 1;
    z-index: 2;
}

/* Closed badge */
.service-closed {
    position: absolute; top: -4px; left: -4px;
    background: var(--red);
    color: white;
    font-size: 8px; font-weight: 700;
    padding: 2px 5px;
    border-radius: 6px;
    line-height: 1;
    z-index: 2;
}

.service-item.closed .service-icon-wrap {
    opacity: 0.4;
    filter: grayscale(0.5);
}

/* ============== Catalog ============== */
.search-wrap { padding: 12px 16px 0; }
.search-box {
    display: flex; align-items: center; gap: 10px;
    padding: 0 14px; height: 44px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    flex: 1; height: 100%;
    font-size: 14px;
}
.search-box input::placeholder { color: var(--text-muted); }

.filter-wrap {
    padding: 12px 16px;
    position: sticky; top: var(--header-h); z-index: 50;
    background: rgba(13,13,13,0.9);
    backdrop-filter: blur(10px);
}
.filter-scroll {
    display: flex; gap: 8px;
    overflow-x: auto; scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
    flex-shrink: 0; padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}
.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Catalog List Items */
.catalog-list { padding: 0 16px 16px; }
.catalog-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    animation: fadeInUp 0.3s ease backwards;
    position: relative;
}
.catalog-item:active { transform: scale(0.98); background: var(--bg-card-hover); }

.catalog-item-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.catalog-item-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.catalog-item-info { flex: 1; min-width: 0; }
.catalog-item-name {
    font-size: 15px; font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.catalog-item-desc {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.catalog-item-right {
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 4px;
    flex-shrink: 0;
}
.catalog-item-price {
    font-family: 'Outfit', sans-serif;
    font-size: 17px; font-weight: 700;
    color: var(--green);
}
.catalog-item-old-price {
    font-size: 12px; color: var(--text-muted);
    text-decoration: line-through;
}
.catalog-item-stock {
    font-size: 10px; font-weight: 600;
    color: var(--text-muted);
}
.catalog-item.closed { opacity: 0.5; }
.catalog-item.closed .catalog-item-price { color: var(--red); }

/* ============== Product Detail ============== */
.product-detail { padding: 16px; padding-bottom: 100px; }
.pd-header {
    display: flex; flex-direction: column; align-items: center;
    padding: 32px 16px; margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative; overflow: hidden;
}
.pd-header::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 50%;
    opacity: 0.15;
}
.pd-icon {
    width: 80px; height: 80px;
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    position: relative; z-index: 1;
}
.pd-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 22px;
}
.pd-name {
    font-family: 'Outfit', sans-serif;
    font-size: 24px; font-weight: 800;
    text-align: center; margin-bottom: 8px;
    position: relative; z-index: 1;
}
.pd-category {
    font-size: 13px; color: var(--text-muted);
    position: relative; z-index: 1;
}

.pd-price-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px; margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.pd-price {
    font-family: 'Outfit', sans-serif;
    font-size: 32px; font-weight: 800;
    color: var(--green);
}
.pd-old-price {
    font-size: 18px; color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 10px;
}
.pd-discount {
    padding: 6px 12px; border-radius: 8px;
    background: rgba(239,68,68,0.15);
    color: var(--red);
    font-size: 14px; font-weight: 700;
}
.pd-stock {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 14px; margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    font-size: 13px; color: var(--text-secondary);
}
.pd-stock .stock-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green);
    animation: pulse-dot 1.5s infinite;
}
.pd-stock.out-of-stock .stock-dot { background: var(--red); animation: none; }

.pd-description {
    padding: 16px; margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.pd-description h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.pd-description p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.pd-features {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 20px;
}
.pd-feature {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; background: var(--bg-card);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    font-size: 13px; color: var(--text-secondary);
}
.pd-feature span:first-child { font-size: 18px; }

/* Detail bottom bar */
.pd-bottom {
    position: fixed; bottom: 0; left: 0; width: 100%;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(13,13,13,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex; gap: 12px; z-index: 90;
}
.pd-bottom .btn-cart {
    flex: 1; padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    font-size: 15px; font-weight: 700;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(59,91,219,0.3);
}
.pd-bottom .btn-cart:active { transform: scale(0.97); }
.pd-bottom .btn-cart.added { background: var(--green); }
.pd-bottom .btn-buy-now {
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    background: var(--green);
    color: white;
    font-size: 15px; font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}
.pd-bottom .btn-buy-now:active { transform: scale(0.97); }

/* ============== Stars ============== */
.stars-content { padding: 16px; }
.stars-hero {
    text-align: center; padding: 32px 16px;
    margin-bottom: 20px;
}
.stars-glow {
    font-size: 64px;
    filter: drop-shadow(0 0 20px rgba(245,158,11,0.5));
    margin-bottom: 12px;
    animation: pulse-fire 2s infinite;
}
.stars-hero h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px; font-weight: 800;
    margin-bottom: 8px;
}
.stars-hero p { color: var(--text-secondary); font-size: 14px; }

.stars-packages {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; margin-bottom: 20px;
}
.star-pack {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    padding: 20px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.star-pack:active { transform: scale(0.95); border-color: var(--orange); }
.star-pack.popular { border-color: var(--orange); }
.pack-badge {
    position: absolute; top: -8px;
    padding: 2px 10px; border-radius: 8px;
    background: var(--orange); color: white;
    font-size: 10px; font-weight: 700;
}
.pack-stars { font-size: 18px; font-weight: 700; }
.pack-price {
    font-family: 'Outfit', sans-serif;
    font-size: 20px; font-weight: 800;
    color: var(--green);
}
.stars-note { text-align: center; font-size: 13px; color: var(--text-muted); }

/* ============== Cart ============== */
.cart-header-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; padding-bottom: 8px;
}
.cart-header-bar h2 { font-family: 'Outfit', sans-serif; font-size: 20px; font-weight: 700; }
.cart-clear-btn {
    font-size: 13px; color: var(--red);
    font-weight: 600;
}
.cart-items { padding: 0 16px; }
.cart-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    animation: fadeInUp 0.3s ease backwards;
}
.cart-item-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.cart-item-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 12px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item-price {
    font-family: 'Outfit', sans-serif;
    font-size: 15px; font-weight: 700;
    color: var(--green); margin-top: 2px;
}
.cart-item-remove {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(239,68,68,0.1);
    color: var(--red);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}
.cart-item-remove:active { transform: scale(0.9); }

.cart-footer {
    position: fixed; bottom: var(--nav-h); left: 0; width: 100%;
    padding: 14px 16px;
    background: rgba(13,13,13,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 80;
}
.cart-total {
    display: flex; justify-content: space-between;
    margin-bottom: 12px; font-size: 16px;
}
.cart-total-price {
    font-family: 'Outfit', sans-serif;
    font-size: 22px; font-weight: 800; color: var(--green);
}

/* ============== Checkout ============== */
.checkout-wrap { padding: 16px; }
.checkout-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px; font-weight: 700;
    margin-bottom: 16px;
}
.checkout-summary {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 14px; margin-bottom: 16px;
}
.checkout-item {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 14px;
    color: var(--text-secondary);
}
.checkout-item-price { font-weight: 600; color: var(--text); }
.checkout-total-row {
    display: flex; justify-content: space-between;
    padding-top: 10px; margin-top: 8px;
    border-top: 1px solid var(--border);
    font-weight: 700;
}
.checkout-total-val {
    font-family: 'Outfit', sans-serif;
    font-size: 20px; font-weight: 800; color: var(--green);
}

.checkout-form { margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-input, .checkout-input {
    width: 100%; padding: 13px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    font-size: 14px; color: var(--text);
    transition: var(--transition);
    box-sizing: border-box;
}
.form-input:focus, .checkout-input:focus { border-color: var(--accent); outline: none; }
.form-input::placeholder, .checkout-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 70px; resize: vertical; }

.payment-methods {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.pay-method {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    padding: 10px 8px;
    background: var(--bg-card);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    font-size: 11px; font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}
.pay-method span { font-size: 20px; }
.pay-method.active {
    background: rgba(59,91,219,0.15);
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ============== Buttons ============== */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #007aff 0%, #0051a8 100%);
    color: white;
    font-size: 15px; font-weight: 700;
    font-family: 'Apple Color Emoji', 'Inter', sans-serif;
    border: 1px solid rgba(0, 122, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.25);
    width: 100%;
}
.btn-primary:active { transform: scale(0.96); box-shadow: 0 2px 10px rgba(0, 122, 255, 0.15); }
.btn-primary.small { padding: 10px 20px; font-size: 13px; width: auto; border-radius: var(--radius-xs); }

.btn-buy {
    width: 100%; padding: 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    color: white;
    font-size: 15px; font-weight: 700;
    font-family: 'Apple Color Emoji', 'Inter', sans-serif;
    border: 1px solid rgba(40, 167, 69, 0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.25);
}
.btn-buy:active { transform: scale(0.96); box-shadow: 0 2px 10px rgba(40, 167, 69, 0.15); }
.btn-buy:disabled { opacity: 0.4; pointer-events: none; background: #333; border-color: transparent; box-shadow: none; }
.btn-buy.full { width: 100%; }

/* ============== Success ============== */
.success-wrap {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 60vh; text-align: center; padding: 24px;
}
.success-check {
    font-size: 72px; margin-bottom: 16px;
    animation: popIn 0.5s ease;
}
.success-wrap h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px; font-weight: 800; margin-bottom: 8px;
}
.success-wrap p {
    font-size: 14px; color: var(--text-secondary); margin-bottom: 8px;
}

/* ============== Empty State ============== */
.empty-state {
    display: flex; flex-direction: column;
    align-items: center; padding: 40px 16px;
    text-align: center;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state p { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }

/* ============== Bottom Nav ============== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    height: var(--nav-h);
    background: rgba(13,13,13,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}
.nav-btn {
    display: flex; flex-direction: column;
    align-items: center; gap: 3px;
    padding: 6px 12px;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative; border-radius: 12px;
}
.nav-btn span { font-size: 10px; font-weight: 500; }
.nav-btn:active { transform: scale(0.9); }
.nav-btn.active { color: var(--accent-light); }
.nav-btn.active svg path, .nav-btn.active svg rect, .nav-btn.active svg circle {
    stroke: var(--accent-light);
}
.nav-badge {
    position: absolute; top: 0; right: 4px;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    background: var(--red); color: white;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    animation: popIn 0.3s ease;
}

/* ============== Toast ============== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + 12px);
    left: 50%; transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px; font-weight: 500;
    z-index: 200; opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============== Pages ============== */
.page { display: none; min-height: calc(100vh - var(--header-h) - var(--nav-h)); }
.page.active { display: block; animation: fadeIn 0.25s ease; }

/* ============== Animations ============== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes pulse-fire {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes loading-bar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}
@keyframes shimmer {
    to { background-position: -200% 0; }
}
.shimmer {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}


/* ============== Profile ============== */
.profile-wrap { padding: 16px; }
.profile-card {
    display: flex; align-items: center; gap: 16px;
    padding: 20px; background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.profile-avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: white;
}
.profile-details h3 { font-size: 18px; font-weight: 700; }
.profile-details p { font-size: 13px; color: var(--text-muted); }
.user-id-badge {
    display: inline-block; padding: 3px 8px;
    border-radius: 6px; background: rgba(0, 122, 255, 0.15);
    font-size: 11px; color: #3390ec; font-weight: 600;
    margin-top: 4px;
}

.profile-stats {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; margin-bottom: 20px;
}
.profile-stat-box {
    display: flex; flex-direction: column; align-items: center;
    padding: 16px; background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.profile-stat-box .stat-num {
    font-family: 'Outfit', sans-serif;
    font-size: 22px; font-weight: 800; color: var(--green);
}
.profile-stat-box .stat-txt { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.profile-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px; font-weight: 700;
    margin-bottom: 12px;
}

.profile-menu { margin-top: 20px; }
.profile-menu-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    width: 100%; text-align: left;
    font-size: 14px; font-weight: 600;
    transition: var(--transition);
}
.profile-menu-btn:active { transform: scale(0.98); background: var(--bg-card-hover); }

/* ============== Language Screen ============== */
.lang-screen {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9998;
    padding: 24px;
    transition: opacity 0.4s, visibility 0.4s;
}
.lang-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.lang-content { text-align: center; max-width: 320px; width: 100%; }
.lang-globe { font-size: 54px; display: block; margin-bottom: 16px; animation: bounce 2s infinite; }
.lang-screen h2 { font-size: 16px; font-weight: 700; margin-bottom: 24px; color: var(--text); line-height: 1.5; }
.lang-buttons { display: flex; flex-direction: column; gap: 12px; }
.lang-btn-select {
    width: 100%; padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 15px; font-weight: 600;
    color: var(--text);
    text-align: center;
    transition: var(--transition);
}
.lang-btn-select:active { transform: scale(0.97); background: var(--bg-card-hover); border-color: var(--accent); }


/* ============== User Dropdown Menu ============== */
.user-dropdown {
    position: absolute; top: calc(var(--header-h) + 12px); right: 16px;
    width: 250px; background: rgba(26,26,26,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5); z-index: 1000;
    padding: 12px;
    animation: popIn 0.25s ease;
}
.user-dropdown.hidden { display: none !important; }
.dropdown-header {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.dropdown-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: white;
}
.dropdown-details h4 { font-size: 14px; font-weight: 700; color: var(--text); }
.dropdown-details span {
    font-size: 11px; color: var(--accent-light); cursor: pointer;
    text-decoration: underline; display: inline-block; margin-top: 2px;
}
.dropdown-menu-list { display: flex; flex-direction: column; gap: 4px; }
.dropdown-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px; border-radius: var(--radius-xs);
    cursor: pointer; transition: var(--transition);
}
.dropdown-item:not(.no-hover):active { background: rgba(255,255,255,0.06); }
.dropdown-item.no-hover { cursor: default; }
.dd-item-icon { font-size: 16px; }
.dd-item-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.dd-wallet-row { display: flex; justify-content: space-between; align-items: center; flex: 1; }
.dd-wallet-val { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; color: var(--green); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger .dd-item-title { color: var(--red); }

/* ============== Redesigned Profile ============== */
.profile-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; margin-bottom: 20px;
}
.p-stat-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 14px 8px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.p-stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 18px; font-weight: 800; color: var(--text);
}
.p-stat-lbl {
    font-size: 9px; font-weight: 700; color: var(--text-muted);
    margin-top: 4px; letter-spacing: 0.5px;
}

.action-list {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 20px;
}
.action-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
}
.action-item:active { transform: scale(0.98); background: var(--bg-card-hover); }
.action-item-left { display: flex; align-items: center; gap: 14px; }
.action-item-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4daaff, #007aff);
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.25);
    flex-shrink: 0;
}
.action-item-icon svg {
    width: 20px; height: 20px;
    fill: white;
    filter: drop-shadow(0px 2px 3px rgba(0,0,0,0.3));
}

.action-item-title { font-size: 14px; font-weight: 700; color: var(--text); }
.action-item-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.action-item-arrow { font-size: 18px; color: var(--text-muted); font-weight: 300; }

/* API Access Card */
.api-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px;
    margin-bottom: 12px;
}
.api-card-header { font-size: 14px; font-weight: 700; color: var(--text); }
.api-card-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 4px; margin-bottom: 12px; }
.api-token-row { display: flex; gap: 8px; }
.api-token-input-field {
    flex: 1; min-width: 0;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-xs); padding: 10px 12px;
    font-family: monospace; font-size: 12px; color: var(--cyan);
    text-overflow: ellipsis;
}
.btn-api-generate {
    padding: 10px 16px; background: rgba(59,91,219,0.15);
    border: 1px solid rgba(59,91,219,0.3); border-radius: var(--radius-xs);
    font-size: 12px; font-weight: 700; color: var(--accent-light);
    transition: var(--transition);
}
.btn-api-generate:active { transform: scale(0.95); background: rgba(59,91,219,0.3); }

/* ============== Recharge Modal ============== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; padding: 16px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0; visibility: hidden; pointer-events: none;
}
.recharge-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px; max-width: 400px; width: 100%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.recharge-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.recharge-card-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px; font-weight: 800; color: var(--text);
}
.modal-close-btn {
    background: none; border: none;
    font-size: 20px; color: var(--text-muted);
    cursor: pointer; padding: 4px;
    transition: var(--transition);
}
.modal-close-btn:hover { color: var(--text); }

.recharge-subtitle {
    font-size: 12px; font-weight: 700; color: var(--text-muted);
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}

.recharge-payment-methods {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    margin-bottom: 16px;
}
.recharge-pay-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px; display: flex; flex-direction: column;
    align-items: center; gap: 8px; cursor: pointer;
    transition: var(--transition);
}
.recharge-pay-btn:active { transform: scale(0.97); }
.recharge-pay-btn.active {
    border-color: var(--accent);
    background: rgba(59, 91, 219, 0.1);
}
.pay-logo-wrap {
    width: 50px; height: 32px;
    border-radius: 6px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.pay-logo-svg {
    width: 100%; height: 100%;
}
.recharge-pay-btn span {
    font-size: 13px; font-weight: 700; color: var(--text-secondary);
}
.recharge-pay-btn.active span {
    color: var(--accent-light);
}

.recharge-quick-amounts {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-bottom: 16px;
}
.recharge-amount-chip {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 4px;
    font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 700;
    color: var(--text); text-align: center; cursor: pointer;
    transition: var(--transition);
}
.recharge-amount-chip:active { transform: scale(0.95); }
.recharge-amount-chip.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.recharge-input-wrapper {
    display: flex; align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px; gap: 8px;
}
.recharge-input-icon { font-size: 18px; }
.recharge-amount-input {
    flex: 1; border: none; background: none;
    font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700;
    color: var(--text); outline: none; padding: 0; width: 100%;
}
/* Chrome, Safari, Edge, Opera */
.recharge-amount-input::-webkit-outer-spin-button,
.recharge-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
/* Firefox */
.recharge-amount-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.recharge-input-unit {
    font-size: 13px; font-weight: 700; color: var(--text-muted);
}

/* Step 2 styles */
.recharge-sum-container {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px; text-align: center;
    margin-bottom: 16px;
    display: flex; flex-direction: column; gap: 4px;
}
.recharge-sum-label {
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.recharge-sum-val {
    font-family: 'Outfit', sans-serif;
    font-size: 26px; font-weight: 800; color: #10b981;
}

.recharge-card-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px; margin-bottom: 16px;
}
.recharge-box-label {
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    display: block; margin-bottom: 6px;
}
.recharge-card-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
}
.recharge-card-num {
    font-family: monospace; font-size: 18px; font-weight: 700;
    color: var(--cyan); letter-spacing: 1px;
}
.btn-copy-card {
    background: rgba(255,255,255,0.06); border: 1px solid var(--border);
    border-radius: 6px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition);
}
.btn-copy-card:active { transform: scale(0.9); background: rgba(255,255,255,0.12); }
.recharge-card-holder {
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
}

.recharge-steps-list {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 16px;
}
.recharge-step-item {
    display: flex; gap: 12px; align-items: flex-start;
}
.recharge-step-item .step-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent); color: white;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
}
.recharge-step-item .step-text {
    font-size: 13px; color: var(--text-secondary); line-height: 1.4;
}

.recharge-status-alert {
    display: flex; align-items: center; gap: 12px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 14px; margin-bottom: 16px;
}
.recharge-spinner-wrap {
    flex-shrink: 0;
}
.recharge-mini-spinner {
    width: 20px; height: 20px;
    border: 3px solid rgba(16, 185, 129, 0.1);
    border-top: 3px solid #10b981;
    border-radius: 50%;
    animation: recharge-spin 1s linear infinite;
}
@keyframes recharge-spin {
    to { transform: rotate(360deg); }
}

.recharge-status-details {
    flex: 1;
}
.recharge-status-title {
    font-size: 13px; font-weight: 700; color: var(--text);
}
.recharge-status-desc {
    font-size: 10px; color: var(--text-muted); margin-top: 1px;
}
.recharge-timer {
    font-family: monospace; font-size: 16px; font-weight: 700;
    color: var(--text); background: rgba(255,255,255,0.06);
    padding: 4px 8px; border-radius: 6px;
}

.recharge-time-limit {
    font-size: 11px; color: var(--text-muted);
    text-align: center; display: block; margin-top: 8px;
}


/* ============== Responsive ============== */
@media (min-width: 400px) {
    .services-grid { gap: 18px 14px; }
    .service-icon-wrap { width: 68px; height: 68px; }
}


/* ============== Light Theme ============== */
[data-theme="light"] {
    --bg: #f2f2f7;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f5;
    --bg-elevated: #ffffff;
    --bg-input: #e8e8ed;
    --bg-tab: #e8e8ed;
    --bg-tab-active: #3b5bdb;

    --text: #1c1c1e;
    --text-secondary: #636366;
    --text-muted: #aeaeb2;

    --border: rgba(0,0,0,0.08);
    --border-active: rgba(59,91,219,0.4);
}

[data-theme="light"] .header {
    background: rgba(242,242,247,0.92);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

[data-theme="light"] .bottom-nav {
    background: rgba(255,255,255,0.95);
    border-top: 1px solid rgba(0,0,0,0.08);
}

[data-theme="light"] .brand-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .tab-bar {
    background: var(--bg-card);
}

[data-theme="light"] .user-dropdown {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

[data-theme="light"] .service-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .catalog-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .cart-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .toast {
    background: rgba(0,0,0,0.85);
    color: #fff;
}

[data-theme="light"] .modal-overlay {
    background: rgba(0,0,0,0.4);
}

[data-theme="light"] .recharge-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
}

[data-theme="light"] .checkout-input,
[data-theme="light"] .form-input {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

[data-theme="light"] .filter-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

[data-theme="light"] .pay-method {
    background: var(--bg-input);
    border: 1px solid var(--border);
}

[data-theme="light"] .action-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .p-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .api-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .loading-screen {
    background: var(--bg);
}

[data-theme="light"] .lang-screen {
    background: var(--bg);
}

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

[data-theme="light"] .star-pack {
    background: var(--bg-card);
    border: 1px solid var(--border);
}


/* ============== Settings Page ============== */
.settings-wrap {
    padding: 16px;
}

.settings-page-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.3px;
}

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

.settings-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.settings-lang-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.settings-lang-btn:hover {
    background: var(--bg-card-hover);
}

.settings-lang-btn.active {
    border-color: var(--accent);
    background: rgba(59, 91, 219, 0.1);
    color: var(--accent-light);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-row-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

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

.settings-row-title {
    font-size: 15px;
    font-weight: 600;
}

.settings-row-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}


/* ============== Toggle Switch (iOS style) ============== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #39393d;
    border-radius: 31px;
    transition: 0.3s;
}

[data-theme="light"] .toggle-slider {
    background: #e0e0e0;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: #34c759;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}


/* ============== No Animations ============== */
.no-animations *,
.no-animations *::before,
.no-animations *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

.no-animations video {
    display: none !important;
}

.no-animations .banner-slide .banner-img {
    background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%) !important;
}

/* ============== Settings Background Wallpaper Grid ============== */
.settings-bg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr; /* Force all row cells to have equal heights */
    gap: 10px;
    margin-top: 12px;
}

.settings-bg-item {
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
    background: var(--bg-card);
    aspect-ratio: 9/16;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

.settings-bg-item:active {
    transform: scale(0.95);
}

.settings-bg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.settings-bg-item .bg-selected-tick {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #34c759;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: #fff;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    z-index: 5;
}

/* ============================
   Product Variants
   ============================ */
.pd-variants-section {
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
}

.pd-variants-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pd-variant-card {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.pd-variant-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.pd-variant-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.pd-variant-card:hover::before {
    opacity: 1;
}

.pd-variant-card.selected {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.12);
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.3), 0 4px 16px rgba(124, 58, 237, 0.15);
}

.pd-variant-card.selected::before {
    opacity: 1;
}

.pd-variant-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: #7c3aed;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-variant-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.pd-variant-price {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.pd-variant-current {
    font-size: 15px;
    font-weight: 800;
    color: #34c759;
}

.pd-variant-old {
    font-size: 12px;
    text-decoration: line-through;
    color: #ff453a;
    opacity: 0.6;
}

.pd-variant-badge {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    padding: 2px 6px;
    border-radius: 6px;
}

.pd-variant-stock {
    font-size: 11px;
    opacity: 0.5;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* ============================
   Referral System Styles
   ============================ */
#page-referral {
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

#page-referral .profile-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#page-referral .p-stat-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

#page-referral .p-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 91, 219, 0.3);
}

#page-referral .p-stat-val {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    display: block;
    margin-bottom: 4px;
    font-family: 'Outfit', sans-serif;
}

#page-referral .p-stat-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

#page-referral .api-card {
    background: linear-gradient(135deg, rgba(59, 91, 219, 0.1), rgba(124, 58, 237, 0.05));
    border: 1px solid rgba(59, 91, 219, 0.25);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#page-referral .api-card-header {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

#page-referral .api-card-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 14px;
}

#page-referral .api-token-row {
    display: flex;
    gap: 8px;
}

#page-referral .api-token-input-field {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-family: monospace;
    outline: none;
    transition: border-color 0.2s ease;
}

#page-referral .api-token-input-field:focus {
    border-color: var(--accent);
}

#page-referral .btn-api-generate {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#page-referral .btn-api-generate:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

#page-referral .btn-api-generate:active {
    transform: translateY(0);
}

#ref-friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============== Analytics Page Filter Chips ============== */
.filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.filter-chip.active {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}


/* ============================================================
   PREMIUM OVERLAY SCREENS — Ban & Subscription
   Glassmorphism + Gradient Animations + Floating Particles
   ============================================================ */

/* === Base Overlay === */
.overlay-screen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #fff;
    overflow: hidden;
}

/* Animated gradient backgrounds */
.ban-overlay {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a0a 25%, #1c0810 50%, #0a0a1a 75%, #0a0a0a 100%);
    background-size: 400% 400%;
    animation: overlayGradientShift 12s ease infinite;
}
.sub-overlay {
    background: linear-gradient(135deg, #0a0a14 0%, #0a1020 25%, #0c0a20 50%, #0a1418 75%, #0a0a14 100%);
    background-size: 400% 400%;
    animation: overlayGradientShift 10s ease infinite;
}

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

/* === Floating Particles === */
.overlay-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.overlay-particles::before,
.overlay-particles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: floatParticle 6s ease-in-out infinite;
    opacity: 0.08;
}
.overlay-particles::before {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(99,102,241,0.6), transparent 70%);
    top: -80px; right: -60px;
    animation-delay: 0s;
}
.overlay-particles::after {
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(139,92,246,0.5), transparent 70%);
    bottom: -60px; left: -40px;
    animation-delay: 3s;
}
.ban-overlay .overlay-particles::before {
    background: radial-gradient(circle, rgba(239,68,68,0.5), transparent 70%);
}
.ban-overlay .overlay-particles::after {
    background: radial-gradient(circle, rgba(220,38,38,0.4), transparent 70%);
}

@keyframes floatParticle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.1); }
    66% { transform: translate(-15px, 20px) scale(0.95); }
}

/* === Glass Card === */
.overlay-glass-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 340px;
    padding: 36px 28px 32px;
    border-radius: 24px;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);
    text-align: center;
    animation: cardSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Icon === */
.overlay-icon-wrap {
    width: 88px; height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.overlay-icon {
    font-size: 44px;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    animation: iconPulse 2.5s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Icon glow rings */
.ban-icon-glow {
    background: radial-gradient(circle, rgba(239,68,68,0.15) 0%, transparent 70%);
    box-shadow: 0 0 40px rgba(239,68,68,0.1);
}
.ban-icon-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(239,68,68,0.15);
    animation: glowRing 2s ease-in-out infinite alternate;
}
.sub-icon-glow {
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    box-shadow: 0 0 40px rgba(99,102,241,0.1);
}
.sub-icon-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(99,102,241,0.15);
    animation: glowRing 2s ease-in-out infinite alternate;
}

@keyframes glowRing {
    from { transform: scale(1); opacity: 0.5; }
    to { transform: scale(1.12); opacity: 0.15; }
}

/* === Typography === */
.overlay-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.overlay-desc {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255,255,255,0.55);
    max-width: 280px;
    margin: 0 auto 24px;
}
.overlay-divider {
    width: 48px;
    height: 2px;
    margin: 0 auto 16px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    border-radius: 2px;
}
.overlay-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    line-height: 1.4;
}

/* === Subscription Link Buttons === */
.sub-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.sub-link-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.sub-link-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}
.sub-link-btn:active {
    transform: scale(0.97);
}
.sub-link-btn:active::before {
    opacity: 1;
}

/* Channel button */
.channel-btn {
    background: linear-gradient(135deg, rgba(42,171,238,0.12) 0%, rgba(42,171,238,0.06) 100%);
    border: 1px solid rgba(42,171,238,0.2);
}
.channel-btn:active::before {
    background: rgba(42,171,238,0.08);
}
.channel-btn .sub-btn-icon {
    background: linear-gradient(135deg, #2aabee, #1a8fd4);
    box-shadow: 0 4px 16px rgba(42,171,238,0.3);
}

/* Group button */
.group-btn {
    background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(99,102,241,0.06) 100%);
    border: 1px solid rgba(99,102,241,0.2);
}
.group-btn:active::before {
    background: rgba(99,102,241,0.08);
}
.group-btn .sub-btn-icon {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

/* Button inner elements */
.sub-btn-icon {
    width: 42px; height: 42px;
    min-width: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}
.sub-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}
.sub-btn-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.sub-btn-handle {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}
.sub-btn-arrow {
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.sub-link-btn:active .sub-btn-arrow {
    transform: translateX(3px);
}

/* === Check/Verify Button === */
.sub-check-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 24px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 4px 20px rgba(99,102,241,0.35),
        0 1px 3px rgba(0,0,0,0.2);
    letter-spacing: -0.2px;
}

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

.sub-check-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 12px rgba(99,102,241,0.25);
}

/* Shimmer effect */
.sub-check-shimmer {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.12) 50%,
        transparent 100%
    );
    animation: shimmerSlide 3s ease-in-out infinite;
}

@keyframes shimmerSlide {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.sub-check-content {
    position: relative;
    z-index: 1;
    font-family: 'Apple Color Emoji', 'Inter', sans-serif;
}
