/* style.css - Smart Finance Styles */

/* ============================================
   RESET & GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   CSS VARIABLES - COLOR PALETTE
   ============================================ */
:root {
    --sky-50: #f0f9ff;
    --sky-100: #e0f2fe;
    --sky-200: #bae6fd;
    --sky-300: #7dd3fc;
    --sky-400: #38bdf8;
    --sky-500: #0ea5e9;
    --sky-600: #0284c7;
    --sky-700: #0369a1;
    --sky-800: #075985;
    --sky-900: #0c4a6e;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ============================================
   BODY & LAYOUT
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--sky-100) 0%, var(--sky-300) 100%);
    min-height: 100vh;
    padding-top: 80px;
    color: #333;
    line-height: 1.6;
}

/* ============================================
   NAVBAR - FIXED TOP
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sky-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--sky-700);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: var(--sky-200);
    color: var(--sky-800);
}

.nav-link.active {
    background: var(--sky-500);
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

/* ============================================
   CONTAINER & GRID
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ============================================
   CARD - GLASSMORPHISM
   ============================================ */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sky-800);
    margin-bottom: 1rem;
}

/* ============================================
   SUMMARY CARDS
   ============================================ */
.summary-card {
    background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
}

.summary-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--sky-800);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--sky-200);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: var(--sky-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-control::placeholder {
    color: #999;
}

select.form-control {
    cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--sky-500);
    color: white;
}

.btn-primary:hover {
    background: var(--sky-600);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--sky-200);
    color: var(--sky-800);
}

.btn-secondary:hover {
    background: var(--sky-300);
    transform: translateY(-2px);
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   TABLE
   ============================================ */
.table-responsive {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: rgba(14, 165, 233, 0.1);
}

th {
    padding: 0.75rem;
    text-align: left;
    color: var(--sky-800);
    font-weight: 600;
    font-size: 0.95rem;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--sky-200);
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: rgba(14, 165, 233, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGE
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-income {
    background: #dcfce7;
    color: #166534;
}

.badge-expense {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sky-400), var(--sky-600));
    border-radius: 12px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.progress-warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ============================================
   ALERT
   ============================================ */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--sky-500);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #10b981;
}

/* ============================================
   PROFILE
   ============================================ */
.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--sky-500);
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}

.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--sky-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--sky-600);
    margin: 0 auto 1rem;
    border: 4px solid var(--sky-500);
}

/* ============================================
   TIPS CARD
   ============================================ */
.tips-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 249, 255, 0.9));
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--sky-500);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tips-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.tips-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tips-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sky-800);
    margin-bottom: 0.5rem;
}

.tips-content {
    color: var(--sky-700);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ============================================
   INSIGHT CARD
   ============================================ */
.insight-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid var(--sky-300);
    transition: all 0.3s ease;
}

.insight-card:hover {
    border-color: var(--sky-500);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.insight-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sky-800);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-content {
    color: var(--sky-700);
    line-height: 1.6;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--sky-600);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.125rem;
}

/* ============================================
   STAT ITEMS
   ============================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--sky-200);
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--sky-400);
    background: rgba(255, 255, 255, 0.8);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--sky-700);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sky-800);
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    body {
        padding-top: 100px;
    }

    .navbar-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem 1rem;
    }

    .navbar-nav {
        width: 100%;
        justify-content: center;
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }

    .container {
        padding: 1rem;
    }

    .summary-value {
        font-size: 1.5rem;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .flex-between {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-container {
        height: 250px;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .summary-value {
        font-size: 1.25rem;
    }

    .card-title {
        font-size: 1.125rem;
    }

    .chart-container {
        height: 200px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--sky-100);
}

::-webkit-scrollbar-thumb {
    background: var(--sky-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--sky-500);
}