/**
 * CVS Online - Dark Glassmorphism Theme
 * Professional Dark UI with Red Accents & Glass Effects
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
    --primary: #CC0000;
    --primary-light: #E60000;
    --primary-dark: #990000;
    --accent: #FF1A1A;
    --accent-light: #FF4D4D;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    --white: #FFFFFF;
    --gray-50: rgba(255,255,255,0.03);
    --gray-100: rgba(255,255,255,0.06);
    --gray-200: rgba(255,255,255,0.1);
    --gray-300: rgba(255,255,255,0.16);
    --gray-400: rgba(255,255,255,0.4);
    --gray-500: rgba(255,255,255,0.55);
    --gray-600: rgba(255,255,255,0.7);
    --gray-700: rgba(255,255,255,0.8);
    --gray-800: rgba(255,255,255,0.9);
    --gray-900: #F1F1F1;

    --bg-body: #0D0D0D;
    --bg-card: rgba(255,255,255,0.05);
    --bg-card-border: rgba(255,255,255,0.08);
    --bg-card-hover: rgba(255,255,255,0.08);
    --bg-input: rgba(255,255,255,0.07);
    --bg-dark: var(--primary-dark);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 20px rgba(204,0,0,0.15);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    --radius-sm: 2px;
    --radius-md: 3px;
    --radius-lg: 4px;
    --radius-xl: 6px;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Plus Jakarta Sans', var(--font-body);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background:
        radial-gradient(ellipse 600px 600px at 15% 5%, rgba(204,0,0,0.18), transparent 70%) fixed,
        radial-gradient(ellipse 500px 500px at 85% 75%, rgba(204,0,0,0.14), transparent 70%) fixed,
        radial-gradient(ellipse 400px 400px at 50% 40%, rgba(153,0,0,0.10), transparent 70%) fixed,
        #0a0a0a !important;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===== LAYOUT ===== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
    z-index: 1;
}

/* ===== HEADER ===== */
.header {
    background: rgba(13,13,13,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-4) var(--space-5);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--bg-card-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.header-back {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    opacity: 0.9;
    transition: all 0.2s;
    font-size: 20px;
    border-radius: var(--radius-md);
}

.header-back:hover { opacity: 1; background: var(--bg-card); }

.header-title {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    letter-spacing: -0.01em;
}

.header-action {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    opacity: 0.9;
    transition: all 0.2s;
    font-size: 18px;
    border-radius: var(--radius-md);
}

.header-action:hover { opacity: 1; background: var(--bg-card); }
.header-spacer { width: 38px; }

/* ===== BALANCE CARD ===== */
.balance-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin: calc(-1 * var(--space-6)) var(--space-5) var(--space-5);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

.balance-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: var(--space-1);
}

.balance-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-5);
}

.balance-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s;
    white-space: nowrap;
    position: relative;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 20px rgba(204,0,0,0.25);
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 0 30px rgba(204,0,0,0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--gray-700);
    border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.15);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 0 20px rgba(255,26,26,0.25);
}

.btn-accent:hover {
    background: var(--accent-light);
}

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-glow);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 15px;
}

.btn-block { width: 100%; }

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ===== CONTENT ===== */
.content {
    padding: var(--space-5);
}

.content-flush {
    padding: 0 var(--space-5) var(--space-5);
}

/* ===== SECTION ===== */
.section {
    margin-bottom: var(--space-6);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
}

.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--bg-card-border);
    overflow: hidden;
    transition: all 0.25s;
}

.card:hover {
    border-color: rgba(255,255,255,0.12);
}

.card-body {
    padding: var(--space-5);
}

.card-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--bg-card-border);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--white);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.stats-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat-item {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    border: 1px solid var(--bg-card-border);
    transition: all 0.25s;
}

.stat-item:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto var(--space-3);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.primary { background: rgba(204,0,0,0.2); color: var(--primary-light); }
.stat-icon.accent { background: rgba(255,26,26,0.2); color: var(--accent-light); }
.stat-icon.success { background: rgba(16,185,129,0.2); color: var(--success); }
.stat-icon.info { background: rgba(59,130,246,0.2); color: var(--info); }

.stat-value {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-2);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    transition: all 0.25s;
}

.quick-action:hover {
    border-color: rgba(204,0,0,0.3);
    background: rgba(204,0,0,0.05);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 12px rgba(204,0,0,0.3);
}

.quick-action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
}

/* ===== MENU LIST ===== */
.menu-list {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-card-border);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--bg-card-border);
    transition: background 0.2s;
}

.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg-card-hover); }

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--gray-600);
    flex-shrink: 0;
}

.menu-icon.primary { background: rgba(204,0,0,0.15); color: var(--primary-light); }
.menu-icon.accent { background: rgba(255,26,26,0.15); color: var(--accent-light); }
.menu-icon.success { background: rgba(16,185,129,0.15); color: var(--success); }

.menu-content { flex: 1; min-width: 0; }

.menu-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.menu-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

.menu-arrow {
    color: var(--gray-400);
    font-size: 16px;
}

.menu-badge {
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    background: var(--primary);
    color: var(--white);
}

/* ===== PRODUCT CARDS ===== */
.product-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.product-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-card-border);
    overflow: hidden;
    transition: all 0.25s;
}

.product-card:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(204,0,0,0.2);
    transform: translateY(-2px);
}

.product-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
}

.product-price {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: #FFD700;
}

.product-body { padding: var(--space-4); }

.product-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.product-stat {
    text-align: center;
    padding: var(--space-3);
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
}

.product-stat-value {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-light);
}

.product-stat-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 2px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: var(--space-5); }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--white);
    transition: all 0.25s;
}

.form-input::placeholder { color: var(--gray-400); }

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(204,0,0,0.15), var(--shadow-glow);
    background: rgba(255,255,255,0.1);
}

.form-input-lg {
    padding: var(--space-4) var(--space-5);
    font-size: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: var(--space-2);
}

/* ===== VALUE GRID ===== */
.value-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.value-option {
    padding: var(--space-3) var(--space-2);
    text-align: center;
    background: var(--bg-card);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.25s;
}

.value-option:hover {
    border-color: rgba(204,0,0,0.4);
    background: rgba(204,0,0,0.05);
}

.value-option.active,
.value-option.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-glow);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-primary { background: rgba(204,0,0,0.15); color: var(--primary-light); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-5);
}

.empty-icon {
    font-size: 48px;
    color: var(--gray-400);
    margin-bottom: var(--space-4);
}

.empty-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.empty-text {
    font-size: 14px;
    color: var(--gray-500);
}

/* ===== TABBAR ===== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 1000;
    background: rgba(13,13,13,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--bg-card-border);
    padding: var(--space-2) 0 calc(var(--space-2) + env(safe-area-inset-bottom));
}

.tabbar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-2) var(--space-4);
    color: var(--gray-400);
    transition: color 0.2s;
}

.tab-item i { font-size: 22px; }

.tab-item span {
    font-size: 10px;
    font-weight: 600;
}

.tab-item:hover,
.tab-item.active {
    color: var(--primary-light);
}

.tab-main { margin-top: -20px; }

.tab-main-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(204,0,0,0.4);
    transition: all 0.25s;
}

.tab-main-btn:hover {
    background: var(--primary-light);
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(204,0,0,0.5);
}

/* ===== PROFILE ===== */
.profile-header {
    background: linear-gradient(135deg, rgba(204,0,0,0.2) 0%, rgba(153,0,0,0.15) 100%);
    border-bottom: 1px solid var(--bg-card-border);
    padding: var(--space-6) var(--space-5);
    text-align: center;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    background: rgba(204,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-light);
    border: 2px solid rgba(204,0,0,0.3);
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--space-1);
}

.profile-info {
    font-size: 13px;
    color: var(--gray-500);
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: rgba(204,0,0,0.2);
    border: 1px solid rgba(204,0,0,0.3);
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    margin-top: var(--space-3);
}

/* ===== PLAN DISABLED ===== */
.plan-disabled { opacity: 0.5; }

.plan-btn-disabled {
    background: rgba(255,255,255,0.1) !important;
    cursor: not-allowed;
    opacity: 0.6;
    color: var(--gray-500) !important;
}

.plan-btn-disabled:hover {
    background: rgba(255,255,255,0.1) !important;
    transform: none;
}

/* ===== UTILITIES ===== */
.text-primary { color: var(--primary-light) !important; }
.text-accent { color: var(--accent-light) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(204,0,0,0.2); }
    50% { box-shadow: 0 0 30px rgba(204,0,0,0.4); }
}

.animate-in { animation: fadeIn 0.3s ease forwards; }
.animate-up { animation: fadeInUp 0.4s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: glowPulse 2s ease-in-out infinite; }

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
    .balance-value { font-size: 28px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
