/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #154E9B;
    --secondary-color: #4784F1;
    --accent-color: #6BA3FF;
    --text-dark: #1A1A1A;
    --text-light: #6B7280;
    --text-muted: #9CA3AF;
    --background-light: #FAFBFC;
    --background-white: #FFFFFF;
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-light: linear-gradient(135deg, #F8FAFC, #E2E8F0);
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Gradient */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: var(--gradient-light);
    z-index: -1;
    opacity: 0.8;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    padding: 1rem 0;
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background-white);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 200;
    margin-top: 0.5rem;
}

.export-dropdown.active .export-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-option {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
    transition: all var(--transition-fast);
}

.export-option:hover {
    background: var(--background-light);
    color: var(--primary-color);
}

.export-option:first-child {
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.export-option:last-child {
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero-section {
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Stats Section */
.stats-section {
    margin-bottom: 3rem;
}

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

.stat-card {
    background: var(--background-white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

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

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-lg);
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

/* Form Section */
.form-section {
    margin-bottom: 3rem;
}

.form-container {
    background: var(--background-white);
    border-radius: var(--border-radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

.expense-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input,
.form-select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--background-white);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(71, 132, 241, 0.1);
}

.form-input.error,
.form-select.error {
    border-color: var(--error-color);
}

.input-wrapper {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-weight: 600;
    z-index: 1;
}

.input-wrapper .form-input {
    padding-left: 2.5rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--error-color);
    margin-top: 0.25rem;
    min-height: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--border-medium);
}

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

.btn-full {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

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

.btn-danger:hover {
    background: #DC2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Charts Section */
.charts-section {
    margin-bottom: 3rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.chart-container {
    background: var(--background-white);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.chart-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Filter Section */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--background-white);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Expenses Section */
.expenses-section {
    margin-bottom: 3rem;
}

.expenses-container {
    min-height: 400px;
}

.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expense-item {
    background: var(--background-white);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.3s ease-out forwards;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.expense-item.expanded {
    box-shadow: var(--shadow-lg);
}

.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.expense-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.expense-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.expense-details {
    flex: 1;
    min-width: 0;
}

.expense-description {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.expense-category {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--background-light);
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.expense-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.expense-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.expense-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.expense-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease-out;
}

.expense-item.expanded .expense-content {
    max-height: 200px;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    margin-top: 1rem;
}

.expense-full-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--text-dark);
}

/* Empty State */
.expenses-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--background-white);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.empty-icon {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-message {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 400px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-color);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--background-white);
    border-radius: var(--border-radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.75rem;
    color: var(--text-light);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--background-light);
    color: var(--text-dark);
}

/* Budget Section */
.budget-section {
    margin-bottom: 3rem;
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
}

.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.budget-card {
    background: var(--background-white);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

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

.budget-card.over-budget {
    border-color: var(--error-color);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.03), rgba(239, 68, 68, 0.01));
}

.budget-card.warning {
    border-color: var(--warning-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.03), rgba(245, 158, 11, 0.01));
}

.budget-card.on-track {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03), rgba(16, 185, 129, 0.01));
}

.budget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--success-color);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.budget-card.over-budget::before {
    background: var(--error-color);
    transform: scaleX(1);
}

.budget-card.warning::before {
    background: var(--warning-color);
    transform: scaleX(1);
}

.budget-card.on-track::before {
    background: var(--success-color);
    transform: scaleX(1);
}

.budget-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.budget-category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.budget-category-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.budget-category-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.budget-period {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    background: var(--background-light);
    border-radius: var(--border-radius-sm);
}

.budget-progress {
    margin-bottom: 1rem;
}

.budget-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.budget-progress-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 4px;
    transition: all var(--transition-normal);
}

.budget-progress-fill.warning {
    background: var(--warning-color);
}

.budget-progress-fill.over-budget {
    background: var(--error-color);
}

.budget-amounts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.budget-spent {
    font-weight: 600;
    color: var(--text-dark);
}

.budget-limit {
    color: var(--text-light);
}

.budget-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    margin-top: 0.75rem;
}

.budget-status.on-track {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.budget-status.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.budget-status.over-budget {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--background-white);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: all var(--transition-normal);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 0;
    margin-bottom: 2rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--background-light);
    color: var(--text-dark);
}

.modal-content {
    padding: 0 2rem 2rem;
}

.budget-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.budget-list-container {
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
}

.budget-list-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.budget-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.budget-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--background-light);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-light);
}

.budget-list-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.budget-list-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.budget-list-details {
    flex: 1;
}

.budget-list-category {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.budget-list-amount {
    font-size: 0.75rem;
    color: var(--text-light);
}

.budget-list-actions {
    display: flex;
    gap: 0.5rem;
}

/* Login Modal Styles */
.login-modal {
    z-index: 2000;
    backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-modal.active {
    opacity: 1;
    visibility: visible;
}

.login-container {
    max-width: 420px;
    width: 90%;
    pointer-events: auto;
    z-index: 2001;
    position: relative;
}

.login-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper .form-input {
    width: 100%;
    padding-right: 3rem; /* Space for toggle button */
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text-dark);
    background: var(--background-light);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
}

.login-note {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.login-note p {
    color: var(--text-light);
    font-size: 0.8rem;
    margin: 0;
}

/* Authentication overlay */
.app-locked #navbar,
.app-locked #hero,
.app-locked #expense-form,
.app-locked #expenses,
.app-locked #budget-section,
.app-locked #analytics {
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
}

/* Content Protection */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection only in input fields */
input, textarea, select, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Disable image dragging */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Disable text highlighting */
::selection {
    background: transparent;
}

::-moz-selection {
    background: transparent;
}

/* Disable right-click context menu */
body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide scrollbars to prevent inspection */
::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Category Icons - Now using dynamic gradients from JavaScript */

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .export-menu {
        right: 0;
        left: auto;
        min-width: 160px;
    }

    .budget-section .section-title {
        font-size: 1.5rem;
    }

    .budget-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .budget-card {
        padding: 1rem;
    }

    .modal-container {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }

    .modal-header {
        padding: 1.5rem 1.5rem 0;
        margin-bottom: 1.5rem;
    }

    .modal-content {
        padding: 0 1.5rem 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .budget-list-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .budget-list-actions {
        min-width: 100px;
    }

    .login-container {
        max-width: 400px;
    }

    .password-input-wrapper {
        flex-direction: column;
    }

    .password-toggle {
        position: relative;
        right: auto;
        top: -45px;
        align-self: flex-end;
        margin-right: 10px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 2rem 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls {
        justify-content: stretch;
    }
    
    .filter-select {
        flex: 1;
    }
    
    .expense-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .expense-actions {
        justify-content: space-between;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }
    
    .toast {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .nav-brand .brand-text {
        display: none;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
    }
    
    .form-container {
        padding: 1.5rem 1rem;
    }
    
    .chart-container {
        padding: 1.5rem;
    }
    
    .expense-item {
        padding: 1rem;
    }
    
    .expense-main {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .expense-icon {
        align-self: center;
        width: 40px;
        height: 40px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .form-section,
    .charts-section,
    .filter-section,
    .toast-container,
    .loading-overlay {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .hero-section {
        padding: 1rem 0;
    }
    
    .expense-item {
        box-shadow: none;
        border: 1px solid var(--border-medium);
        break-inside: avoid;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-input:focus,
.form-select:focus,
.filter-select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
