/* ----- GLOBAL STYLES ----- */

/* The below '*' selector is required for proper sizing of the elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Using CSS variables for consistent theming across the webpages of our website */
:root {
    --primary-color: #5b21b6;
    --primary-dark: #4c1d95;
    --secondary-color: #0ea5e9;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #fafafa;
    --light-text: #6b7280;
    --dark-text: #1f2937;
    --border-color: #e5e7eb;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
}

html,
body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.5;
}

body {
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* ----- NAVBAR ----- */

.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8fb 100%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.nav-logo {
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: 40px;
    flex-shrink: 0;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.btn-primary:hover {
    color: white;
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link.btn-primary.active {
    color: white;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* ----- BUTTONS ----- */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 33, 182, 0.4);
}

.btn-large {
    padding: 16px 40px;
    font-size: 16px;
    transition: all 0.3s ease;
}

/* -----   ALERTS ----- */

.alert-box {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.alert-error {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ----- CONTAINER ------ */

.container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

/* ----- HOME PAGE ----- */

.home-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 140px 20px 140px;
    min-height: 300px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.home-hero::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.features-section {
    margin-top: 60px;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 36px;
    color: var(--dark-text);
    font-weight: 700;
    position: relative;
}

.features-section h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 20px auto 0;
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px 12px 0 0;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 20px;
}

.feature-card p {
    color: var(--light-text);
    line-height: 1.6;
}

/* ----- AUTH PAGES ----- */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-card {
    background: white;
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px 16px 0 0;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: var(--light-text);
    margin-bottom: 35px;
    font-size: 14px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafafa;
    color: var(--dark-text);
}

.form-group input::placeholder {
    color: var(--light-text);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.auth-switch {
    text-align: center;
    margin-top: 25px;
    color: var(--light-text);
    font-size: 14px;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-switch a:hover {
    color: var(--secondary-color);
}

/* ----- DASHBOARD ----- */

.add-expense-section {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.add-expense-section h2 {
    margin-bottom: 25px;
    color: var(--dark-text);
    font-size: 22px;
    display: flex;
    align-items: center;
}

.add-expense-section h2::before {
    content: "";
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    margin-right: 12px;
}

.stats-section {
    margin-bottom: 30px;
}

.stats-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(91, 33, 182, 0.05), rgba(14, 165, 233, 0.05));
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    color: var(--light-text);
    font-weight: 500;
    margin-bottom: 12px;
    font-size: 14px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.transactions-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.transactions-section h2 {
    margin-bottom: 20px;
    color: var(--dark-text);
    font-size: 22px;
    display: flex;
    align-items: center;
}

.transactions-section h2::before {
    content: "";
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    margin-right: 12px;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.transaction-item:hover {
    background: white;
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.transaction-info {
    flex: 1;
}

.transaction-description {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark-text);
}

.transaction-category {
    font-size: 12px;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 5px;
    font-weight: 500;
}

.transaction-date {
    font-size: 12px;
    color: var(--light-text);
}

.transaction-amount {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--success-color), #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: right;
}

.loading {
    text-align: center;
    color: var(--light-text);
    padding: 20px;
}

/* ----- Profile Page ----- */

.profile-section {
    margin-bottom: 30px;
}

.profile-section h2 {
    margin-bottom: 20px;
    color: var(--dark-text);
    font-size: 22px;
    display: flex;
    align-items: center;
}

.profile-section h2::before {
    content: "";
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    margin-right: 12px;
}

.profile-card {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.profile-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.profile-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.profile-item label {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 14px;
}

.profile-item p {
    color: var(--dark-text);
    font-size: 16px;
}

/* ----- RESPONSIVE DESIGN ----- */

@media (max-width: 768px) {
    .nav-menu {
        gap: 15px;
        font-size: 14px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    .container {
        padding: 20px 15px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-section h2 {
        font-size: 28px;
    }

    .auth-card {
        padding: 30px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .transaction-amount {
        margin-top: 10px;
        text-align: left;
    }

    .add-expense-section,
    .transactions-section,
    .profile-card,
    .predictions-section {
        padding: 20px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 10px;
    }

    .nav-logo {
        font-size: 18px;
    }

    .hero-content h1 {
        font-size: 24px;
    }

    .features-section h2 {
        font-size: 24px;
    }

    .btn-large {
        width: 100%;
        text-align: center;
    }

    .auth-card {
        padding: 20px;
    }

    .add-expense-section,
    .transactions-section,
    .profile-card,
    .predictions-section {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }
}

/* ----- Period Tabs ----- */

.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.tab-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--border-color);
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.tab-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: #f8f9fa;
}

.tab-btn.active {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(91, 33, 182, 0.1), rgba(14, 165, 233, 0.1));
    border-color: var(--primary-color);
}

/* ----- Charts Section ----- */

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-height: 350px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.chart-container:hover {
    box-shadow: var(--shadow-md);
}

.chart-container h3 {
    margin: 0 0 20px 0;
    color: var(--dark-text);
    font-size: 18px;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 280px;
}

/* -----   Transactions Table ----- */

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
    transition: all 0.3s ease;
    background: white;
    color: var(--dark-text);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.filter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.filter-group select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
    color: #374151;
}

.filter-group select:hover {
    border-color: var(--primary-color);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#transactionsTable {
    width: 100%;
    border-collapse: collapse;
}

#transactionsTable thead {
    background: linear-gradient(135deg, rgba(91, 33, 182, 0.03), rgba(14, 165, 233, 0.03));
    border-bottom: 2px solid var(--border-color);
}

#transactionsTable th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

#transactionsTable th:hover {
    background: rgba(91, 33, 182, 0.05);
}

#transactionsTable th.sortable::after {
    content: " ↕";
    opacity: 0.5;
    font-size: 12px;
}

#transactionsTable th.sort-asc::after {
    content: " ↑";
    opacity: 1;
}

#transactionsTable th.sort-desc::after {
    content: " ↓";
    opacity: 1;
}

#transactionsTable tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

#transactionsTable tbody tr:hover {
    background: #fafafa;
}

#transactionsTable td {
    padding: 16px;
    color: var(--dark-text);
    font-size: 14px;
}

.category-tag {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(91, 33, 182, 0.1), rgba(14, 165, 233, 0.1));
    border: 1px solid rgba(91, 33, 182, 0.2);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
}

.amount-cell {
    font-weight: 600;
    color: var(--success-color);
    text-align: right;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--light-text);
    font-style: italic;
}

/* ----- Summary Section ----- */

.summary-section {
    margin-bottom: 40px;
}

/* ----- Mobile Responsive ----- */

@media (max-width: 768px) {
    .charts-section {
        grid-template-columns: 1fr;
    }

    .transactions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        flex: 1;
    }

    .tab-container {
        overflow-x: auto;
    }

    .table-container {
        overflow-x: auto;
    }

    #transactionsTable {
        min-width: 600px;
    }
}

/* -----   Predictions Section ----- */

.predictions-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.predictions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.predictions-header h2 {
    margin: 0;
    color: var(--text-dark);
}

.predictions-content {
    min-height: 100px;
}

.predictions-info {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
    font-size: 16px;
}

.predictions-error {
    text-align: center;
    padding: 30px;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffc107;
}

.predictions-error p {
    margin: 10px 0;
    color: #856404;
}

.predictions-hint {
    font-size: 14px;
    opacity: 0.8;
}

.predictions-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.prediction-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.prediction-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.prediction-value {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

.prediction-value.accuracy-good {
    color: #4caf50;
}

.prediction-value.accuracy-medium {
    color: #ff9800;
}

.prediction-value.accuracy-low {
    color: #f44336;
}

.prediction-card.model-accuracy-card {
    background: white;
    color: var(--dark-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-color);
}

.predictions-details {
    margin-top: 30px;
}

.predictions-details h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
}

.predictions-table {
    overflow-x: auto;
}

.predictions-table table {
    width: 100%;
    border-collapse: collapse;
}

.predictions-table thead {
    background: linear-gradient(135deg, rgba(91, 33, 182, 0.03), rgba(14, 165, 233, 0.03));
}

.predictions-table th {
    padding: 12px;
    text-align: center;
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: 14px;
}

.predictions-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    text-align: center;
}

.predictions-table tbody tr:hover {
    background: #fafafa;
}

.predictions-note {
    margin-top: 20px;
    padding: 15px;
    background: #dbeafe;
    border-radius: 8px;
    color: #1e40af;
    font-size: 14px;
    border-left: 4px solid var(--secondary-color);
}

@media (max-width: 768px) {
    .predictions-header {
        flex-direction: column;
        gap: 15px;
    }

    .predictions-header h2 {
        font-size: 20px;
    }

    .predictions-summary {
        grid-template-columns: 1fr;
    }

    .prediction-card {
        padding: 20px;
    }

    .prediction-value {
        font-size: 24px;
    }

    .predictions-table table {
        min-width: 400px;
    }
}

/* ===========================
   FOOTER
   =========================== */

.footer {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8fb 100%);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.footer-logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-text {
    color: var(--light-text);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 20px;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--light-text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .footer {
        padding: 20px 0;
    }

    .footer-links {
        gap: 15px;
    }
}

/* ===========================
   WELCOME SECTION
   =========================== */

.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    animation: fadeInUp 0.6s ease-out;
}

.welcome-content h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.welcome-content p {
    font-size: 16px;
    opacity: 0.95;
}

.streak-badges-container {
    display: flex;
    gap: 20px;
}

.streak-card,
.badges-preview {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.streak-card:hover,
.badges-preview:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.streak-icon,
.badges-icon {
    font-size: 32px;
    line-height: 1;
}

.streak-info,
.badges-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.streak-count,
.badges-count {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.streak-label,
.badges-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

/* ===========================
   BADGES SECTION
   =========================== */

.badges-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out;
}

.badges-section h2 {
    margin-bottom: 25px;
    color: var(--dark-text);
    font-size: 24px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.badge-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.badge-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.badge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.badge-card:hover::before {
    transform: scaleX(1);
}

.badge-emoji {
    font-size: 48px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.badge-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 8px;
}

.badge-description {
    font-size: 13px;
    color: var(--light-text);
    margin-bottom: 10px;
    line-height: 1.4;
}

.badge-date {
    font-size: 11px;
    color: var(--light-text);
    font-style: italic;
}

.no-badges {
    text-align: center;
    color: var(--light-text);
    padding: 40px;
    font-size: 16px;
}

/* ===========================
   IMPROVED STAT CARDS
   =========================== */

.stat-card {
    background: white;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-label {
    color: #374151;
    font-weight: 600;
}

.stat-value {
    color: var(--primary-color);
    font-weight: 700;
}

/* ===========================
   IMPROVED FORM ELEMENTS
   =========================== */

.add-expense-section input,
.add-expense-section select {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--dark-text);
}

.add-expense-section input:focus,
.add-expense-section select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.add-expense-section label {
    color: #374151;
    font-weight: 600;
}

/* ===========================
   IMPROVED TABLE
   =========================== */

#transactionsTable thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#transactionsTable thead th {
    color: white;
    font-weight: 600;
}

#transactionsTable tbody tr:hover {
    background: #f8f9fa;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
    .welcome-section {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .welcome-content h1 {
        font-size: 28px;
    }

    .streak-badges-container {
        width: 100%;
        justify-content: center;
    }

    .streak-card,
    .badges-preview {
        flex: 1;
        padding: 15px 20px;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .streak-badges-container {
        flex-direction: column;
        width: 100%;
    }

    .streak-card,
    .badges-preview {
        width: 100%;
    }
}

/* ===========================
   TRANSACTION ACTIONS
   =========================== */

.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px 10px;
    margin: 0 2px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

.btn-delete:hover {
    background: #fee2e2;
}

.btn-edit:hover {
    background: #dbeafe;
}

/* ===========================
   MODAL
   =========================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    color: #9ca3af;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--dark-text);
}

.modal-content h2 {
    margin-bottom: 25px;
    color: var(--dark-text);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

.btn-secondary {
    background: #e5e7eb;
    color: var(--dark-text);
}

.btn-secondary:hover {
    background: #d1d5db;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10% 20px;
        padding: 20px;
    }

    .actions-cell {
        font-size: 16px;
    }
}
