/* Vault - Modern & Slick Stylesheet */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(252, 70, 107, 0.3), transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(103, 178, 255, 0.3), transparent 50%);
    z-index: -1;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
    gap: 1.5rem;
}

.col {
    flex: 1;
    padding: 0 12px;
}

.col-2 { flex: 0 0 calc(16.666% - 1.5rem); max-width: calc(16.666% - 1.5rem); }
.col-3 { flex: 0 0 calc(25% - 1.5rem); max-width: calc(25% - 1.5rem); }
.col-4 { flex: 0 0 calc(33.333% - 1.5rem); max-width: calc(33.333% - 1.5rem); }
.col-6 { flex: 0 0 calc(50% - 1.5rem); max-width: calc(50% - 1.5rem); }
.col-8 { flex: 0 0 calc(66.666% - 1.5rem); max-width: calc(66.666% - 1.5rem); }
.col-9 { flex: 0 0 calc(75% - 1.5rem); max-width: calc(75% - 1.5rem); }
.col-12 { flex: 0 0 calc(100% - 1.5rem); max-width: calc(100% - 1.5rem); }

/* Header */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
    display: block;
}

.nav-links li a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

/* Page Headers */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-header .text-muted,
.page-header p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.1rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    min-width: 0;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

.card-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    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='%231e293b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Month and date inputs */
input[type="month"],
input[type="date"] {
    cursor: pointer;
    position: relative;
}

input[type="month"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    background: transparent;
    color: var(--primary-color);
    font-size: 1.1rem;
    padding: 4px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    box-shadow: var(--shadow-lg);
}

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

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

/* Tables */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 1rem 0.75rem;
    text-align: left;
}

.table thead {
    background: linear-gradient(135deg, var(--light-color) 0%, #e2e8f0 100%);
}

.table th {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.table th:first-child {
    border-top-left-radius: var(--border-radius-sm);
}

.table th:last-child {
    border-top-right-radius: var(--border-radius-sm);
}

.table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.table-striped tbody tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.5);
}

.editable-cell {
    position: relative;
    padding: 0.75rem !important;
}

.editable-cell:hover {
    background-color: rgba(102, 126, 234, 0.08) !important;
    cursor: pointer;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

/* Dashboard Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (min-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.75rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

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

.stat-card:hover {
    box-shadow: var(--shadow-xl);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

@media (min-width: 1200px) {
    .stat-value {
        font-size: 2rem;
    }
}

@media (min-width: 1400px) {
    .stat-value {
        font-size: 2.25rem;
    }
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    max-width: 450px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-card .card-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Budget Overview Categories */
.budget-category-item {
    margin-bottom: 2rem !important;
}

.budget-category-item:last-child,
.budget-category-item:nth-last-child(2) {
    margin-bottom: 1rem !important;
}

/* Budget progress bars */
.progress {
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #34d399);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 999px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar.over-budget {
    background: linear-gradient(90deg, var(--danger-color), #f87171);
}

/* Transaction amounts */
.amount-positive {
    color: var(--success-color);
    font-weight: 700;
}

.amount-negative {
    color: var(--danger-color);
    font-weight: 700;
}

/* Action buttons in tables */
.table .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin: 0 0.25rem;
}

/* Responsive design */
@media (max-width: 1024px) {
    .col-4 {
        flex: 0 0 calc(50% - 1.5rem);
        max-width: calc(50% - 1.5rem);
    }
    
    .col-4:nth-child(3) {
        flex: 0 0 calc(100% - 1.5rem);
        max-width: calc(100% - 1.5rem);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .row {
        gap: 1rem;
    }
    
    .col-6, .col-4, .col-3, .col-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 0.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li a {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .login-card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Text gradient utility */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8f9fa;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-title {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--dark-color);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.modal-content .form-group {
    margin-bottom: 1rem;
}
