/* ExpenseTracker Web Application Styles */

:root {
    /* Dark Theme Variables */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #252525;
    --bg-sidebar: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-active: rgba(77, 121, 255, 0.1);
    
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    
    --border-color: #333333;
    
    /* Color Variables */
    --primary: #4d79ff;
    --primary-dark: #3a66e0;
    --secondary: #6c757d;
    --success: #28c76f;
    --success-dark: #1f9d57;
    --info: #00cfe8;
    --info-dark: #00a8bd;
    --warning: #ff9f43;
    --warning-dark: #e08c3c;
    --danger: #ea5455;
    --danger-dark: #d03f40;
    
    /* Shadow Variables */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
    /* Additional styles for badges and alerts */
    --badge-bg-success: rgba(40, 199, 111, 0.2);
    --badge-bg-danger: rgba(234, 84, 85, 0.2);
    --badge-bg-warning: rgba(255, 159, 67, 0.2);
    --badge-bg-info: rgba(0, 207, 232, 0.2);
    
    /* Chart Colors */
    --chart-blue: #4d79ff;
    --chart-green: #4cd964;
    --chart-orange: #ff9500;
    --chart-red: #ff3b30;
    --chart-purple: #af52de;
    --chart-yellow: #ffcc00;
    --chart-teal: #5ac8fa;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Base Styles */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Sidebar Styles */
.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 0;
    transition: all 0.3s;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
}

.logo-container {
    padding: 20px 0;
    text-align: center;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background-color: var(--primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: var(--shadow-md);
    margin-bottom: 10px;
}

.logo-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 8px;
    display: block;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav .nav-link {
    padding: 12px 20px;
    margin: 5px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.sidebar-nav .nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav .nav-link.active {
    background-color: var(--bg-active);
    color: var(--primary);
    font-weight: 500;
}

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

/* Main Content Styles */
.main-content {
    padding: 0;
    background-color: var(--bg-primary);
}

.main-header {
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    position: relative;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 12px;
    color: var(--text-muted);
}

.search-box input {
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 100%;
}

.search-box input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 121, 255, 0.2);
}

.user-menu {
    display: inline-block;
}

.user-menu a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.user-menu a:hover {
    background-color: var(--bg-hover);
}

.user-menu i {
    font-size: 24px;
    margin-right: 10px;
    color: var(--primary);
}

.user-menu .dropdown-menu {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 8px;
    margin-top: 10px;
}

.user-menu .dropdown-item {
    color: var(--text-primary);
    padding: 8px 16px;
}

.user-menu .dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
}

.user-menu .dropdown-divider {
    border-top: 1px solid var(--border-color);
}

/* Content Wrapper */
.content-wrapper {
    padding: 30px;
    background-color: var(--bg-primary);
}

/* Card Styles */
.card {
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.card-header {
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.card-header h5, .card-header .mb-0 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
}

/* Stat Card */
.stat-card {
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

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

.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: var(--shadow-sm);
}

.stat-card .details h3 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .details p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card .trend {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
}

.stat-card .trend.up {
    color: var(--success);
}

.stat-card .trend.down {
    color: var(--danger);
}

.stat-card .trend i {
    margin-right: 5px;
}

/* Table Styles */
.table {
    margin-bottom: 0;
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--bg-hover);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-hover);
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

/* Category icon in tables */
.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 10px;
    color: white;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    background-color: var(--success-dark);
    border-color: var(--success-dark);
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger-dark);
    border-color: var(--danger-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover {
    background-color: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-action {
    padding: 6px 12px;
    margin-right: 5px;
    border-radius: 6px;
}

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

/* Chart Styles */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    padding: 10px;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 8px;
    padding: 10px 15px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(77, 121, 255, 0.2);
    color: var(--text-primary);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.input-group-text {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.form-check-input {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Badge Styles */
.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 12px;
}

.badge-success {
    background-color: var(--badge-bg-success);
    color: var(--success);
}

.badge-danger {
    background-color: var(--badge-bg-danger);
    color: var(--danger);
}

.badge-warning {
    background-color: var(--badge-bg-warning);
    color: var(--warning);
}

.badge-info {
    background-color: var(--badge-bg-info);
    color: var(--info);
}

/* Pagination Styles */
.pagination .page-item .page-link {
    border-radius: 8px;
    margin: 0 3px;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination .page-item .page-link:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .logo-container {
        padding: 10px 0;
    }

    .sidebar .logo-text {
        display: none;
    }

    .sidebar .nav-link span {
        display: none;
    }

    .sidebar .nav-link i {
        margin-right: 0;
        font-size: 20px;
    }

    .sidebar .nav-link {
        justify-content: center;
        padding: 12px;
    }

    .content-wrapper {
        padding: 20px 15px;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 10px 15px;
    }
    
    .search-box {
        max-width: 200px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card .icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-card .details h3 {
        font-size: 22px;
    }
}

@media (max-width: 576px) {
    .search-box {
        display: none;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header .btn {
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 999;
        width: 0;
        overflow: hidden;
    }
    
    .sidebar.show {
        width: 250px;
    }
    
    .main-content {
        width: 100%;
    }
}
/* Search Box Styles */
.search-box {
    position: relative;
    max-width: 300px;
    margin-right: auto;
    margin-left: 20px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 12px;
    color: #fff;
    z-index: 1;
}

.search-box input {
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 100%;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 121, 255, 0.2);
    width: 350px; /* Expand on focus */
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 350px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results-section {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.search-results-section:last-child {
    border-bottom: none;
}

.search-results-section h6 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #fff;
    display: flex;
    align-items: center;
}

.search-results-section h6 .badge {
    margin-left: 8px;
}

.search-results-section .result-item {
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.search-results-section .result-item:hover {
    background-color: var(--bg-hover);
}

.search-results-section .result-item .result-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: white;
    flex-shrink: 0;
}

.search-results-section .result-item .result-details {
    flex-grow: 1;
    overflow: hidden;
}

.search-results-section .result-item .result-title {
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-results-section .result-item .result-subtitle {
    font-size: 12px;
    color: #fff;
}

.search-results-section .result-item .result-amount {
    margin-left: 10px;
    font-weight: 600;
}

.search-results-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Mark (highlight) styling */
mark {
    background-color: rgba(77, 121, 255, 0.2);
    color: var(--primary);
    padding: 0 2px;
    border-radius: 2px;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 20px;
    color: #fff;
    display: none;
}

/* Search results page specific */
.search-results-container {
    margin-bottom: 30px;
}

.search-form .form-control {
    width: 300px;
}

.category-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}