/* index.css */

/* --- CSS Variables & Design System --- */
:root {
    /* Colors */
    --bg-dark: #0f172a;
    --bg-darker: #0b1121;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #334155;
    --secondary-hover: #475569;

    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --success: #10b981;
    --error: #ef4444;

    /* Glassmorphism */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Layout & Styling */
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* --- Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0, transparent 50%);
    background-attachment: fixed;
}

.hidden {
    display: none !important;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
    margin-bottom: 24px;
}

/* --- Utilities --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-xl);
}

/* --- Layout --- */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

#user-info-chip {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
}

.credit-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.credit-icon {
    font-size: 1.1em;
}

/* --- Forms & Buttons --- */
.input-group {
    margin-bottom: 16px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

button {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    transition: var(--transition-fast);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: var(--secondary);
    color: white;
    border-radius: var(--radius-md);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.error-msg {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    font-size: 0.85rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    text-align: center;
}

/* --- Views --- */
.view-section {
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth View */
.auth-card {
    max-width: 400px;
    margin: 0 auto;
    padding: 32px;
    text-align: center;
}

.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.tab.active {
    background: var(--secondary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Dashboard View */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.dashboard-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.full-width {
    grid-column: 1 / -1;
}

.card-header h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Profile Info */
.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.details h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Balance */
.balance-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.balance-display {
    text-align: center;
}

.balance-amount {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.balance-label {
    display: block;
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* Store Pricing Tiers */
.pricing-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.tier-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition-normal);
}

.tier-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.premium-tier {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-color: rgba(139, 92, 246, 0.3);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}

.tier-header h4 {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
}

.price span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.features {
    list-style: none;
    flex: 1;
    margin-bottom: 24px;
}

.features li {
    padding: 8px 0;
    font-size: 0.9rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 16px;
    }
}