/* CSS Variables - Matching React Dashboard */
:root {
    --background: hsl(290, 35%, 6%);
    --foreground: hsl(0, 0%, 98%);
    --card: hsl(290, 30%, 9%);
    --card-foreground: hsl(0, 0%, 98%);
    --primary: hsl(27, 100%, 50%);
    --primary-foreground: hsl(290, 35%, 6%);
    --secondary: hsl(290, 25%, 14%);
    --secondary-foreground: hsl(0, 0%, 90%);
    --muted: hsl(290, 25%, 12%);
    --muted-foreground: hsl(255, 10%, 60%);
    --accent: hsl(19, 100%, 50%);
    --border: hsl(290, 20%, 18%);
    
    /* Gradients */
    --gradient-start: hsl(36, 100%, 50%);
    --gradient-mid: hsl(27, 100%, 50%);
    --gradient-end: hsl(19, 100%, 50%);
    
    /* Tier colors */
    --tier-vip: hsl(36, 100%, 50%);
    --tier-platinum: hsl(255, 4%, 75%);
    --tier-priority: hsl(19, 100%, 50%);
    
    /* Status colors */
    --trend-up: hsl(150, 80%, 45%);
    --trend-down: hsl(0, 85%, 60%);
    
    /* Chart colors */
    --chart-1: hsl(27, 100%, 50%);
    --chart-2: hsl(36, 100%, 50%);
    --chart-3: hsl(19, 100%, 50%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--background);
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--foreground);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--foreground);
    font-size: 1rem;
    text-align: left;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(27, 100%, 50%, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--primary-foreground);
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 115, 0, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
}

.message.success {
    background: hsla(150, 80%, 45%, 0.1);
    color: var(--trend-up);
    border: 1px solid var(--trend-up);
}

.message.error {
    background: hsla(0, 85%, 60%, 0.1);
    color: var(--trend-down);
    border: 1px solid var(--trend-down);
}

.error-message {
    background: hsla(0, 85%, 60%, 0.1);
    color: var(--trend-down);
    border: 1px solid var(--trend-down);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.ambient-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ambient-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    top: -200px;
    left: -200px;
}

.circle-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    top: 30%;
    right: -200px;
}

.circle-3 {
    width: 450px;
    height: 450px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    bottom: -200px;
    left: 30%;
}

.dashboard-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .dashboard-header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.header-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.time-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.375rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 1rem;
}

.filter-pill {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover {
    background: var(--muted);
    color: var(--foreground);
}

.filter-pill.active {
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 600;
}

/* Cards */
.cards-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.snapshot-cards {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .snapshot-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .snapshot-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.detail-cards {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .detail-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card {
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-4px);
}

/* Match Dashboard2.1MVP glass-card + glow-effect styles */
.glass-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: linear-gradient(135deg, hsl(290, 30%, 9%, 0.9), hsl(290, 30%, 9%, 0.7));
    backdrop-filter: blur(20px);
    border: 1px solid hsla(290, 20%, 18%, 0.6);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, hsla(27, 100%, 50%, 0.3), transparent);
}

.glow-effect {
    box-shadow:
        0 0 0 1px hsla(290, 20%, 18%, 0.5),
        0 4px 24px -4px hsla(27, 100%, 50%, 0.15),
        0 12px 48px -8px hsla(290, 35%, 6%, 0.8);
}

.glow-effect-hover:hover {
    box-shadow:
        0 0 0 1px hsla(27, 100%, 50%, 0.4),
        0 8px 32px -4px hsla(27, 100%, 50%, 0.3),
        0 16px 56px -8px hsla(290, 35%, 6%, 0.9);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
}

.card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: linear-gradient(135deg, hsla(27, 100%, 50%, 0.25), hsla(36, 100%, 50%, 0.2));
    border: 1px solid hsla(27, 100%, 50%, 0.3);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.trend-indicator.trend-up {
    background: hsla(150, 80%, 45%, 0.1);
    color: var(--trend-up);
}

.trend-indicator.trend-down {
    background: hsla(0, 85%, 60%, 0.1);
    color: var(--trend-down);
}

.trend-indicator.trend-neutral {
    background: var(--secondary);
    color: var(--muted-foreground);
}

.trend-arrow {
    font-weight: 600;
}

.stat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.stat-footer-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
}

/* Tier badges */
.tier-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    background: var(--secondary);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 500;
}

.tier-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
}

.tier-badge.tier-vip .tier-dot {
    background: var(--tier-vip);
    box-shadow: 0 0 10px hsla(36, 100%, 50%, 0.3);
}

.tier-badge.tier-platinum .tier-dot {
    background: var(--tier-platinum);
    box-shadow: 0 0 10px hsla(255, 4%, 75%, 0.3);
}

.tier-badge.tier-priority .tier-dot {
    background: var(--tier-priority);
    box-shadow: 0 0 10px hsla(19, 100%, 50%, 0.3);
}

.tier-count {
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

/* Balance */
.balance-amount {
    color: var(--trend-up);
}

.balance-pending {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: var(--secondary);
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.balance-pending strong {
    color: var(--foreground);
    font-weight: 500;
}

/* Chart Card */
.chart-card {
    grid-column: 1 / -1;
    margin-bottom: 2rem; /* Match vertical gap between sections */
}

.chart-header {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .chart-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.card-subtitle {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.chart-type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.375rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 1rem;
}

.chart-type-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-type-btn:hover {
    background: var(--muted);
    color: var(--foreground);
}

.chart-type-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 600;
}

#mainChart, #pieChart {
    max-height: 320px;
}

/* Tier Breakdown */
.tier-stack-bar {
    display: flex;
    height: 0.75rem;
    border-radius: 9999px;
    overflow: hidden;
    background: var(--secondary);
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.tier-segment {
    height: 100%;
    transition: width 0.5s;
}

.tier-segment.tier-vip {
    background: var(--tier-vip);
}

.tier-segment.tier-platinum {
    background: var(--tier-platinum);
}

.tier-segment.tier-priority {
    background: var(--tier-priority);
}

.tier-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tier-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: var(--secondary);
    border: 1px solid var(--border);
}

.tier-item-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.tier-item-icon.tier-vip {
    background: hsla(36, 100%, 50%, 0.2);
}

.tier-item-icon.tier-platinum {
    background: hsla(255, 4%, 75%, 0.2);
}

.tier-item-icon.tier-priority {
    background: hsla(19, 100%, 50%, 0.2);
}

.tier-item-info {
    flex: 1;
}

.tier-item-name {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.tier-item-percentage {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.tier-item-count {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tier-item-count.tier-vip {
    color: var(--tier-vip);
}

.tier-item-count.tier-platinum {
    color: var(--tier-platinum);
}

.tier-item-count.tier-priority {
    color: var(--tier-priority);
}

/* Balance Details */
.balance-detail {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.balance-detail.available {
    background: linear-gradient(135deg, hsla(150, 80%, 45%, 0.1), hsla(36, 100%, 50%, 0.1));
    border: 1px solid hsla(150, 80%, 45%, 0.2);
}

.balance-detail.pending {
    background: var(--secondary);
    border: 1px solid var(--border);
}

.balance-detail .balance-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: hsla(150, 80%, 45%, 0.2);
    border: 1px solid hsla(150, 80%, 45%, 0.3);
}

.balance-detail.pending .balance-icon {
    background: var(--secondary);
    border: 1px solid var(--border);
}

.balance-info {
    flex: 1;
}

.balance-label {
    display: block;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.25rem;
}

.balance-amount-large {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.balance-detail.available .balance-amount-large {
    color: var(--trend-up);
}

.balance-note {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}
