/* ============================================
   FINANCE TRACKER - MODERN UI/UX
   Dark Mode Premium dengan Animasi
   ============================================ */

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    
    /* Accent Colors */
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    
    /* Background */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Borders */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-glow: rgba(99, 102, 241, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 20s infinite ease-in-out;
}

.bg-gradient-orb.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-gradient-orb.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.bg-gradient-orb.orb-3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(100px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-50px, 100px) scale(0.9);
    }
    75% {
        transform: translate(-100px, -100px) scale(1.05);
    }
}

/* ===== GLASS MORPHISM ===== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* ===== NAVBAR ===== */
.navbar-glass {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar-glass.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-brand:hover {
    opacity: 0.8;
}

/* ===== BUTTONS ===== */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-telegram {
    background: linear-gradient(135deg, #0088cc, #00a8ff);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 14px 28px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.btn-telegram:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 136, 204, 0.5);
    color: white;
}

.btn-telegram i {
    animation: telegramFly 2s infinite;
}

@keyframes telegramFly {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(3px, -3px) rotate(5deg); }
}

.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* ===== CARDS ===== */
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(99, 102, 241, 0.05));
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ===== INPUTS ===== */
.form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 18px !important;
    font-size: 16px !important;
    transition: var(--transition) !important;
}

.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.input-group-text {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    color: var(--primary-light);
    border-radius: var(--radius-md);
}

/* ===== TABLE ===== */
.table {
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0 4px;
}

.table thead th {
    background: transparent;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 16px;
}

.table tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    border-radius: var(--radius-md);
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.01);
}

.table td {
    padding: 16px;
    vertical-align: middle;
    border: none;
}

/* ===== PROGRESS BARS ===== */
.progress {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    overflow: hidden;
    height: 8px;
}

.progress-bar {
    border-radius: 100px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    position: relative;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== BADGES ===== */
.badge {
    padding: 6px 12px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* ===== DROPDOWN ===== */
.dropdown-menu {
    background: var(--bg-secondary);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 9999 !important;
}

.dropdown-item {
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ===== MODAL ===== */
.modal-content {
    background: var(--bg-secondary);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slideLeft {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slideRight {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Stagger children animation */
.stagger-animation > * {
    opacity: 0;
    animation: fadeInUp 0.5s forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* ===== LANDING PAGE ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-card {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.hero-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0088cc, #00a8ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    margin-bottom: 24px;
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

/* ===== SETUP PAGE ===== */
.setup-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.setup-card {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 560px;
    width: 100%;
    animation: fadeInUp 0.6s ease;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.step-dot.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.step-dot.done {
    background: #22c55e;
    color: white;
}

.step-line {
    width: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.step-line.done {
    background: #22c55e;
}

/* Chat Preview */
.chat-preview {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
}

.chat-bubble {
    background: linear-gradient(135deg, #0088cc, #00a8ff);
    color: white;
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
    display: inline-block;
    font-size: 14px;
    animation: fadeInLeft 0.5s ease;
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== DASHBOARD ===== */
.dashboard-container {
    position: relative;
    z-index: 1;
    padding: 24px 0;
}

.welcome-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease;
}

/* Chart Container */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

/* Category Items */
.category-item {
    padding: 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 4px;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(8px);
}

/* Notification Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.toast-notification {
    background: var(--bg-secondary);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    margin-bottom: 8px;
    animation: slideInRight 0.5s ease;
    box-shadow: var(--shadow-lg);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 992px) {
    .hero-card {
        padding: 32px;
        margin: 16px;
    }
    
    .setup-card {
        padding: 24px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .table {
        font-size: 14px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hero-card {
        padding: 24px;
        border-radius: var(--radius-lg);
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .setup-card {
        padding: 20px;
        margin: 8px;
        border-radius: var(--radius-lg);
    }
    
    .step-indicator {
        gap: 8px;
    }
    
    .step-dot {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .step-line {
        width: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .form-control {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }
    
    .stat-card h3 {
        font-size: 1.25rem;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 12px;
    }
    
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .table td:last-child {
        border-bottom: none;
    }
    
    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .welcome-card {
        padding: 20px;
    }
    
    .navbar-glass {
        padding: 12px 0;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .dropdown-menu {
        width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero-card {
        padding: 20px;
        margin: 8px;
    }
    
    .setup-card {
        padding: 16px;
    }
    
    .btn-telegram {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .stat-card {
        margin-bottom: 8px;
    }
    
    .category-item {
        padding: 8px;
    }
}

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== TOOLTIP ===== */
.tooltip-custom {
    position: relative;
}

.tooltip-custom:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .navbar-glass,
    .bg-animated,
    .btn {
        display: none !important;
    }
    
    .glass-card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}