/* Project Mirai - Anime Neon Glassmorphism Theme */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(255,255,255,0.04);
    --bg-glass: rgba(255,255,255,0.06);
    --border-glass: rgba(255,255,255,0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #818cf8;
    --accent-secondary: #c084fc;
    --accent-pink: #f472b6;
    --accent-green: #34d399;
    --accent-red: #f87171;
    --accent-yellow: #fbbf24;
    --gradient-main: linear-gradient(135deg, #6366f1, #8b5cf6, #c084fc);
    --gradient-card: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.05));
    --shadow-neon: 0 0 20px rgba(129,140,248,0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-width: 260px;
    --font-main: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255,255,255,0.8);
    --bg-glass: rgba(255,255,255,0.6);
    --border-glass: rgba(0,0,0,0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(192,132,252,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(244,114,182,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-secondary); }

/* Layout */
.app-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    padding: 24px 16px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 24px;
}

.sidebar-logo h1 {
    font-size: 20px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.sidebar-logo .logo-icon { font-size: 28px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(129,140,248,0.1);
    color: var(--accent-primary);
}

.nav-item.active { box-shadow: var(--shadow-neon); }

.nav-item .icon { font-size: 18px; width: 24px; text-align: center; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
}

/* Cards */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover { box-shadow: var(--shadow-neon); }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card { text-align: center; }
.stat-card .stat-icon { font-size: 32px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-card.income .stat-value { color: var(--accent-green); }
.stat-card.expense .stat-value { color: var(--accent-red); }
.stat-card.savings .stat-value { color: var(--accent-primary); }

/* Mascot */
.mascot-section {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: var(--gradient-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-glass);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.mascot-section::after {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(192,132,252,0.1), transparent);
    border-radius: 50%;
}

.mascot-avatar { width: 120px; height: 120px; flex-shrink: 0; animation: float 3s ease-in-out infinite; }
.mascot-speech { flex: 1; z-index: 1; }
.mascot-speech .greeting { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.mascot-speech .message { color: var(--text-secondary); font-size: 15px; }

.mascot-stats { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.mascot-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.xp-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: var(--gradient-main);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Quests */
.quest-list { display: flex; flex-direction: column; gap: 8px; }
.quest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    transition: all 0.2s;
}

.quest-item.completed { opacity: 0.6; border-color: rgba(52,211,153,0.3); }
.quest-item.completed .quest-check { background: var(--accent-green); color: #fff; }

.quest-check {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.quest-info { flex: 1; }
.quest-name { font-size: 14px; font-weight: 600; }
.quest-xp { font-size: 12px; color: var(--accent-yellow); font-weight: 700; }

/* Transactions */
.tx-list { display: flex; flex-direction: column; gap: 4px; }
.tx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.tx-item:hover { background: rgba(255,255,255,0.03); }
.tx-icon { font-size: 24px; width: 40px; text-align: center; }
.tx-info { flex: 1; }
.tx-name { font-size: 14px; font-weight: 600; }
.tx-date { font-size: 12px; color: var(--text-muted); }
.tx-amount { font-size: 15px; font-weight: 700; }
.tx-amount.income { color: var(--accent-green); }
.tx-amount.expense { color: var(--accent-red); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.form-input, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129,140,248,0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); color: #fff; }
.btn-secondary { background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Budget bar */
.budget-bar { margin-top: 12px; }
.budget-bar-track { height: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; overflow: hidden; }
.budget-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s; }
.budget-bar-fill.safe { background: var(--accent-green); }
.budget-bar-fill.warning { background: var(--accent-yellow); }
.budget-bar-fill.danger { background: var(--accent-red); }

/* Landing */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(10,10,26,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
}

.landing-nav .logo { font-size: 22px; font-weight: 700; background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.landing-nav .nav-links { display: flex; gap: 32px; align-items: center; }
.landing-nav .nav-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.landing-nav .nav-links a:hover { color: var(--text-primary); }

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 60px;
}

.hero-content { flex: 1; }
.hero-content h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; line-height: 1.2; margin-bottom: 20px; }
.hero-content h1 span { background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-content p { font-size: 18px; color: var(--text-secondary); margin-bottom: 32px; max-width: 500px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-visual { flex: 1; display: flex; justify-content: center; }
.hero-mascot { width: 320px; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 0 40px rgba(129,140,248,0.3)); }

.features-section { padding: 80px 40px; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.section-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 48px; font-size: 16px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.feature-card { padding: 32px; text-align: center; }
.feature-card .feature-icon { font-size: 48px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 1000px; margin: 0 auto; }
.pricing-card { padding: 40px 32px; text-align: center; position: relative; }
.pricing-card.featured { border-color: var(--accent-primary); box-shadow: var(--shadow-neon); }
.pricing-card .plan-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.pricing-card .plan-price { font-size: 40px; font-weight: 800; margin-bottom: 4px; }
.pricing-card .plan-price span { font-size: 16px; color: var(--text-secondary); font-weight: 400; }
.pricing-card .plan-features { list-style: none; margin: 24px 0; text-align: left; }
.pricing-card .plan-features li { padding: 8px 0; font-size: 14px; color: var(--text-secondary); }
.pricing-card .plan-features li::before { content: '✓ '; color: var(--accent-green); font-weight: 700; }

.landing-footer { padding: 40px; text-align: center; border-top: 1px solid var(--border-glass); color: var(--text-muted); font-size: 13px; }

/* Auth */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.auth-card h2 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.auth-card .auth-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; }
.auth-mascot { text-align: center; margin-bottom: 24px; }
.auth-mascot img { width: 80px; animation: float 3s ease-in-out infinite; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: #fca5a5; }
.alert-success { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); color: #6ee7b7; }

/* Admin */
.admin-sidebar { width: 280px; }
.admin-sidebar .nav-section { margin-bottom: 24px; }
.admin-sidebar .nav-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 0 16px; margin-bottom: 8px; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.page-header h2 { font-size: 24px; font-weight: 700; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-glass); font-size: 14px; }
.data-table th { color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-success { background: rgba(52,211,153,0.15); color: var(--accent-green); }
.badge-warning { background: rgba(251,191,36,0.15); color: var(--accent-yellow); }
.badge-danger { background: rgba(248,113,113,0.15); color: var(--accent-red); }

/* Mobile */
.mobile-toggle { display: none; position: fixed; top: 16px; left: 16px; z-index: 200; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 8px; padding: 8px 12px; color: var(--text-primary); cursor: pointer; font-size: 20px; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(129,140,248,0.15); }
    50% { box-shadow: 0 0 30px rgba(129,140,248,0.3); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; padding-top: 60px; }
    .mobile-toggle { display: block; }
    .hero { flex-direction: column; text-align: center; padding: 100px 20px 60px; }
    .hero-content p { margin: 0 auto 32px; }
    .hero-buttons { justify-content: center; }
    .hero-mascot { width: 220px; }
    .mascot-section { flex-direction: column; text-align: center; }
    .landing-nav { padding: 16px 20px; }
    .landing-nav .nav-links { gap: 16px; }
    .card-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
}

/* Chart container */
.chart-container { position: relative; height: 300px; margin-top: 16px; }

.section-title-sm { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.lang-switch { display: flex; gap: 4px; }
.lang-switch a { padding: 4px 8px; border-radius: 6px; font-size: 12px; color: var(--text-muted); }
.lang-switch a.active { background: rgba(129,140,248,0.15); color: var(--accent-primary); }

.streak-fire { font-size: 20px; animation: pulse-glow 2s infinite; }

.goal-progress { margin-top: 8px; }
.goal-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.goal-bar-fill { height: 100%; background: var(--gradient-main); border-radius: 3px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }
