/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Header Section */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header img {
    vertical-align: middle;
    margin-right: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Main Container */
.container {
    background-color: #f5f7fa;
    min-height: calc(100vh - 140px);
    padding: 20px;
    padding-bottom: 80px;
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 16px;
    background-color: #fff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-submit {
    width: auto;
    display: block;
    margin: 20px auto;
}

.btn-login {
    display: block;
    margin: 20px auto;
    min-width: 200px;
}

/* Login Page */
.login-container {
    padding: 40px 20px;
}

/* Expense Display */
.expense-info {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 18px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.expense-info:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.expense-info p {
    margin: 8px 0;
    font-size: 16px;
}

.expense-info strong {
    font-weight: 600;
    color: #1e3c72;
}

/* Section Headers */
.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 14px 16px;
    margin: 15px 0;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    width: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 20px 20px 0 0;
}

.nav-icon {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 28px;
    height: 28px;
}

.nav-icon.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.nav-icon:hover {
    color: #fff;
    transform: scale(1.15);
}

/* Expense List */
.expense-list {
    margin-bottom: 80px;
}

.expense-item {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.expense-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.expense-details {
    flex: 1;
}

.expense-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 10px 14px;
    border: none;
    cursor: pointer;
    font-size: 18px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-view {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    box-shadow: 0 3px 8px rgba(245, 87, 108, 0.3);
}

.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(245, 87, 108, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #fff;
    box-shadow: 0 3px 8px rgba(250, 112, 154, 0.3);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(250, 112, 154, 0.4);
}

/* Charts */
.charts-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 25px;
    margin: 15px 0 80px 0;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chart-label {
    text-align: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1e3c72;
}

.pie-chart,
.bar-chart {
    text-align: center;
}

.pie-chart img,
.bar-chart img {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Admin Panel */
.admin-option {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 18px;
    margin-bottom: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.admin-option:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.admin-option label {
    font-weight: 600;
    font-size: 16px;
    color: #1e3c72;
}

.admin-option button {
    padding: 10px 24px;
}

/* Logout Page */
.logout-container {
    text-align: center;
    padding: 100px 20px;
}

.logout-container h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #1e3c72;
}

/* File Upload */
.file-upload {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    border: 2px dashed #667eea;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: #764ba2;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    transform: scale(1.02);
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload label {
    cursor: pointer;
    display: block;
    font-weight: 600;
    color: #667eea;
}

/* Alert Messages */
.alert {
    padding: 14px 16px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        max-width: 100%;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
}

/* Modal for viewing bills */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    margin: 10% auto;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: #667eea;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #764ba2;
    transform: rotate(90deg);
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}
