/* ===== EXPENSE TRACKER STYLES ===== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Gradient Background */
.gradient-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
}

.gradient-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

/* Navigation Styles */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(33, 37, 41, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.card-body {
    padding: 2rem;
}

/* Balance Display */
.balance-display {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Transaction Items */
.transaction-item {
    transition: all 0.3s ease;
    border-radius: 15px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.transaction-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.transaction-item:hover::before {
    opacity: 1;
}

.transaction-item:hover {
    transform: translateX(10px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.income-border {
    border-left: 5px solid #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
}

.expense-border {
    border-left: 5px solid #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
}

/* Category Badges */
.category-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Amount Styling */
.income-amount {
    color: #28a745;
    font-weight: 700;
    font-size: 1.2rem;
}

.expense-amount {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Button Styles */
.btn {
    border-radius: 25px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    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.2), transparent);
    transition: left 0.5s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: white;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 15px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: translateY(-2px);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px 20px 0 0;
}

.modal-title {
    font-weight: 700;
    color: #2c3e50;
}

/* Toast Styles */
.toast {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.toast.bg-success {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

.toast.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.toast.bg-info {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
}

/* Chart Container */
.chart-wrapper {
    position: relative;
    height: 400px;
    padding: 1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Welcome Section */
#welcome-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#welcome-section h1 {
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

#welcome-section .lead {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

/* Dashboard Stats */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stats-card p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls select {
    min-width: 150px;
}

/* Mobile-First Responsive Design */

/* Large screens (desktop) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .balance-display {
        font-size: 3.5rem;
    }
    
    .stats-card h3 {
        font-size: 3rem;
    }
}

/* Medium screens (tablet) */
@media (max-width: 1199px) and (min-width: 768px) {
    .balance-display {
        font-size: 2.8rem;
    }
    
    .stats-card h3 {
        font-size: 2.5rem;
    }
    
    .card-body {
        padding: 1.8rem;
    }
}

/* Small screens (mobile landscape) */
@media (max-width: 767px) {
    .container {
        padding: 0.75rem;
    }
    
    .balance-display {
        font-size: 2.2rem;
    }
    
    .card-body {
        padding: 1.2rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .filter-controls select {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .transaction-item {
        margin-bottom: 0.75rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    #welcome-section h1 {
        font-size: 2.2rem;
    }
    
    #welcome-section .lead {
        font-size: 1rem;
    }
    
    .stats-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    .stats-card p {
        font-size: 1rem;
    }
    
    /* Improve form layout on mobile */
    .form-control, .form-select {
        padding: 0.8rem 0.9rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better modal sizing */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    /* Improve transaction display on mobile */
    .transaction-item .card-body {
        padding: 1rem;
    }
    
    .transaction-item h6 {
        font-size: 1rem;
    }
    
    .transaction-item .btn-group {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .transaction-item .btn-group .btn {
        width: 100%;
        margin: 0;
    }
}

/* Extra small screens (mobile portrait) */
@media (max-width: 575px) {
    .container {
        padding: 0.5rem;
    }
    
    .balance-display {
        font-size: 1.8rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    #welcome-section h1 {
        font-size: 1.8rem;
    }
    
    #welcome-section .lead {
        font-size: 0.9rem;
    }
    
    .stats-card {
        padding: 1.2rem;
    }
    
    .stats-card h3 {
        font-size: 1.6rem;
    }
    
    .stats-card p {
        font-size: 0.9rem;
    }
    
    /* Stack navigation items */
    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
    }
    
    .navbar-nav .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Improve form spacing */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    /* Better chart display */
    .chart-wrapper {
        height: 300px;
        padding: 0.5rem;
    }
    
    /* Improve toast positioning */
    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        margin-bottom: 0.5rem;
    }
}

/* Ultra small screens */
@media (max-width: 375px) {
    .balance-display {
        font-size: 1.6rem;
    }
    
    .stats-card h3 {
        font-size: 1.4rem;
    }
    
    #welcome-section h1 {
        font-size: 1.6rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

/* Focus States for Accessibility */
.btn:focus, .form-control:focus, .form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Mobile-specific improvements */
@media (max-width: 767px) {
    /* Improve touch targets */
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Better form spacing on mobile */
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    /* Improve modal usability on mobile */
    .modal-dialog {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Better table responsiveness */
    .table-responsive {
        border: none;
    }
    
    /* Improve card shadows on mobile */
    .card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Better spacing for mobile */
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Improve icon sizing on mobile */
    .bi {
        font-size: 1.1em;
    }
    
    /* Better text readability on mobile */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Improve button group layout on mobile */
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
}

/* Print Styles */
@media print {
    .navbar, .btn, .modal {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
} 