/*
 * Modern & Contemporary Dark Theme for Financial App
 * By: AI Assistant
 * Date: June 2025
 */

/* Google Fonts - Using 'Inter' for a clean, modern look */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Bootstrap Icons - Essential for modern UIs */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css');

:root {
    --bg-dark: #202020;
    --bg-card: #1f1e1e;
    --text-light: #ffffff;
    --text-subtle: #f49921;
    --border-subtle: #ffffff82;
    --input-bg: #1F2847;
    --accent-color: #0F3460;
    --bold-accent: #E94560;
    --success: #4caf504f;
    --danger: #d32f2f75;
    --hover-bg: #f49921;
    --active-bg: #ffffff;
    --shadow-soft: rgba(0, 0, 0, 0.4);
    --focus-ring: rgba(233, 69, 96, 0.3);
}

/* Base Body & Layout */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 16px; /* Base font size */
}

.container {
    flex: 1;
    padding-top: 40px; /* More top padding */
    padding-bottom: 60px; /* More bottom padding */
    max-width: 1280px; /* Wider container for modern feel */
    margin-left: auto;
    margin-right: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600; /* Slightly less bold for modern feel */
    color: var(--text-light);
    margin-bottom: 1.2rem;
}
h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

.display-4 {
    font-weight: 700;
    color: var(--text-light);
    font-size: 3.5rem; /* Larger for impact */
    line-height: 1;
    margin-bottom: 0.5rem;
}
p.lead {
    color: var(--text-subtle);
    font-size: 1.15rem;
    font-weight: 300; /* Lighter weight for lead text */
}

/* Navbar */
.navbar {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 15px var(--shadow-soft);
    padding: 0.8rem 0; /* Slightly less padding */
    transition: background-color 0.3s ease-in-out;
}

.navbar-brand {
    font-weight: 700;
    color: var(--text-light) !important;
    font-size: 1.8rem; /* Larger brand text */
    display: flex;
    align-items: center;
}
.navbar-brand i {
    color: var(--bold-accent); /* Bold accent for the logo icon */
    margin-inline-end: 12px;
    font-size: 2.2rem;
}

.navbar-toggler {
    border-color: var(--border-subtle) !important;
    transition: border-color 0.2s ease-in-out;
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28224, 224, 224, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-nav .nav-link {
    color: var(--text-subtle) !important;
    font-weight: 400;
    padding: 0.7rem 1.2rem; /* More generous padding */
    border-radius: 8px; /* Softer rounded corners */
    transition: all 0.3s ease-in-out;
}
.navbar-nav .nav-link:hover {
    color: var(--text-light) !important;
    background-color: var(--hover-bg);
}
.navbar-nav .nav-link.active {
    color: var(--bold-accent) !important; /* Bold accent for active link */
    font-weight: 600;
    background-color: var(--active-bg);
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.2); /* Subtle glow for active item */
}

/* Cards & Sections */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px; /* More rounded cards */
    box-shadow: 0 6px 20px var(--shadow-soft); /* Deeper, softer shadow */
    transition: all 0.3s ease-in-out;
    overflow: hidden; /* For rounded table corners */
}
.card:hover {
    transform: translateY(-5px); /* More pronounced lift on hover */
    box-shadow: 0 10px 25px var(--shadow-soft);
}

.card-header {
    background-color: var(--bg-dark); /* Darker header for contrast with card body */
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-light);
    font-weight: 600;
    padding: 18px 25px; /* More padding */
    border-radius: 12px 12px 0 0 !important;
}

/* Hero Section (Index Page) */
.hero-section {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-dark));
    border: 1px solid var(--border-subtle);
    border-radius: 20px; /* Very rounded hero */
    padding: 5rem 4rem; /* Generous padding */
    text-align: center;
    margin-bottom: 50px;
    box-shadow: 0 10px 30px var(--shadow-soft);
}
.hero-section h1 {
    color: var(--text-light);
    font-size: 3.8rem; /* Larger hero title */
    margin-bottom: 1.8rem;
    line-height: 1.1;
    font-weight: 700;
}

/* Feature Cards (Hero Section) */
.feature-card {
    background-color: var(--bg-dark); /* Even darker for feature cards */
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 3rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease-in-out;
}
.feature-card:hover {
    background-color: var(--hover-bg);
    border-color: var(--bold-accent); /* Bold accent border on hover */
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-soft);
}
.feature-card i {
    color: var(--bold-accent); /* Bold accent for feature icons */
    font-size: 4rem; /* Larger icons */
    margin-bottom: 25px;
    display: block;
}
.feature-card h4 {
    color: var(--text-light);
    margin-bottom: 15px;
    font-weight: 600;
}
.feature-card p {
    color: var(--text-subtle);
    font-size: 1rem;
}

/* Buttons */
.btn {
    border-radius: 10px; /* More rounded buttons */
    font-weight: 600; /* Slightly bolder text */
    padding: 12px 30px;
    font-size: 1.05rem;
    transition: all 0.2s ease-in-out;
    color: white; /* All button text is white */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); /* Subtle shadow on buttons */
}

.btn-primary { /* Primary action buttons */
    background-color: var(--bold-accent);
    border-color: var(--bold-accent);
}
.btn-primary:hover {
    background-color: #c93550; /* Darker shade of bold accent */
    border-color: #c93550;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.btn-success { /* Positive action buttons */
    background-color: var(--success);
    border-color: var(--success);
}
.btn-success:hover {
    background-color: darken(var(--success), 10%);
    border-color: darken(var(--success), 10%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.btn-danger { /* Negative action buttons */
    background-color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover {
    background-color: darken(var(--danger), 10%);
    border-color: darken(var(--danger), 10%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Neutral/Secondary Buttons - Use .btn-secondary or a custom class if needed. Here using .btn-info as a neutral button */
.btn-info {
    background-color: var(--bg-card); /* Neutral background */
    border-color: var(--border-subtle);
    color: var(--text-light) !important;
    box-shadow: none; /* No strong shadow */
}
.btn-info:hover {
    background-color: var(--hover-bg);
    border-color: var(--hover-bg);
    color: var(--text-light) !important;
    transform: translateY(-2px);
}

/* Alerts & Messages */
.alert {
    border-radius: 10px;
    font-weight: 500;
    padding: 1.2rem 1.8rem;
    color: var(--bg-dark); /* Dark text on alert backgrounds for contrast */
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.alert-success { background-color: var(--success); border-color: var(--success); }
.alert-warning { background-color: var(--bold-accent); border-color: var(--bold-accent); }
.alert-danger { background-color: var(--danger); border-color: var(--danger); }
.alert-info { background-color: var(--text-subtle); border-color: var(--text-subtle); color: var(--bg-dark); }


/* Lists & Tables */
.list-group-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-light);
    margin-bottom: -1px;
    padding: 15px 20px; /* More padding */
    transition: background-color 0.2s ease-in-out;
}
.list-group-item:hover {
    background-color: var(--hover-bg);
}
.list-group-item:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.list-group-item:last-child { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }


.table {
    color: var(--text-light);
    border-collapse: separate;
    border-spacing: 0;
}
.table thead th {
    background-color: var(--bg-dark); /* Darker header for table sections */
    color: var(--text-subtle);
    font-weight: 600;
    border-bottom: 2px solid var(--border-subtle);
    padding: 15px 20px;
    border-top: none;
}
.table tbody tr {
    transition: background-color 0.2s ease-in-out;
}
.table tbody tr:hover {
    background-color: var(--hover-bg);
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: white;
}
.table-striped tbody tr:nth-of-type(even) {
    background-color: var(--bg-dark);
}
.table td, .table th {
    border-color: var(--border-subtle);
    padding: 15px 20px;
}
.card .table {
    border-radius: 0 0 12px 12px; /* Match card border-radius */
    overflow: hidden;
}


/* Forms */
.form-label {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
}

.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-subtle);
    color: var(--text-light);
    border-radius: 8px;
    padding: 12px 18px; /* More padding for inputs */
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}
.form-control:focus, .form-select:focus {
    background-color: var(--input-bg);
    color: var(--text-light);
    border-color: var(--bold-accent); /* Bold accent border on focus */
    box-shadow: 0 0 0 0.25rem var(--focus-ring); /* Soft glow */
    outline: none;
}
/* For Bootstrap's select arrow in RTL */
[dir="rtl"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23E0E0E0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-position: left 0.75rem center;
}
[dir="rtl"] .form-select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23E94560' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}


/* Progress Bars (Goals) */
.progress {
    height: 22px; /* Slightly taller */
    border-radius: 11px;
    background-color: var(--input-bg);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3); /* Inner shadow */
}
.progress-bar {
    background-color: var(--bold-accent); /* Bold accent for main progress */
    color: var(--text-light); /* Light text on progress bar */
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 5px rgba(0,0,0,0.3); /* Subtle text shadow */
}
.progress-bar.bg-success { background-color: var(--success) !important; }
.progress-bar.bg-warning { background-color: var(--accent-color) !important; color: var(--text-light) !important;} /* Use accent for warning */
.progress-bar.bg-danger { background-color: var(--danger) !important; }
.progress-bar.bg-info { background-color: var(--accent-color) !important; color: var(--text-light) !important;} /* Use accent for info */


/* Utility Classes & Small Elements */
.text-muted {
    color: var(--text-subtle) !important;
}

.badge {
    font-weight: 500;
    padding: 0.6em 1em;
    border-radius: 18px; /* More rounded badges */
    font-size: 0.85rem;
}
.badge.bg-primary { background-color: var(--bold-accent) !important; color: white !important; }
.badge.bg-secondary { background-color: var(--text-subtle) !important; color: var(--bg-dark) !important; }
.badge.bg-success { background-color: var(--success) !important; color: white !important; }
.badge.bg-danger { background-color: var(--danger) !important; color: white !important; }


/* Preformatted text (for CSV example) */
pre {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    color: var(--text-light);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.95em;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

/* Footer */
footer {
    background-color: var(--bg-card) !important;
    color: var(--text-subtle);
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 0; /* More padding */
    text-align: center;
    margin-top: auto;
    font-size: 0.9rem;
}


/* Chart.js Specific Styling */
canvas {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px var(--shadow-soft);
}
/* Chart.js label/tick colors are set directly in JS for dynamic theming */
/* Example: scales: { y: { ticks: { color: 'var(--text-subtle)' } } } */

/* Responsive Adjustments */
@media (max-width: 992px) { /* Tablet breakpoint for wider container */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .hero-section {
        padding: 4rem 2rem;
    }
    .hero-section h1 {
        font-size: 3rem;
    }
    .feature-card {
        padding: 2.5rem;
    }
}

@media (max-width: 768px) { /* Mobile breakpoint */
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .display-4 { font-size: 2.5rem; }
    .hero-section h1 { font-size: 2.8rem; }
    .hero-section p.lead { font-size: 1rem; }
    .hero-buttons .btn {
        margin-bottom: 15px;
        width: 100%;
    }
    .feature-card {
        padding: 2rem;
        margin-bottom: 20px;
    }
    .navbar-nav {
        margin-top: 1.5rem;
        align-items: flex-start; /* Align nav items to start */
    }
    .navbar-nav .nav-item {
        width: 100%;
        margin-bottom: 5px;
    }
    .navbar-nav .nav-link {
        width: 100%;
        text-align: center;
    }
    .navbar-toggler {
        margin-inline-start: auto;
    }
}

@media (max-width: 576px) { /* Smaller mobile */
    .hero-section {
        padding: 3rem 1.5rem;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .display-4 {
        font-size: 2rem;
    }
    .btn {
        font-size: 0.95rem;
        padding: 10px 20px;
    }
    .feature-card i {
        font-size: 3rem;
    }
}