* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.balance-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.balance-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.balance-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.balance-card h3 {
    color: #666;
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-card p {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.balance {
    color: #2ecc71;
}

.income {
    color: #3498db;
}

.expense {
    color: #e74c3c;
}

/* Main Content */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

/* Form Section */
.form-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f8f9fa;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #e9ecef;
}

.transaction-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Records Section */
.records-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

.clear-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.clear-btn:hover {
    background: #5a6268;
}

/* Records List */
.records-list {
    max-height: 500px;
    overflow-y: auto;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.record-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.record-item.income {
    border-left-color: #2ecc71;
}

.record-item.expense {
    border-left-color: #e74c3c;
}

.record-info {
    flex: 1;
}

.record-amount {
    font-weight: bold;
    font-size: 1.1rem;
}

.record-amount.income {
    color: #2ecc71;
}

.record-amount.expense {
    color: #e74c3c;
}

.record-description {
    color: #666;
    margin-top: 5px;
    font-size: 0.9rem;
}

.record-details {
    text-align: right;
    font-size: 0.8rem;
    color: #888;
}

.record-category {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-bottom: 5px;
    display: inline-block;
}

.record-payment {
    color: #666;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 15px;
    transition: background 0.3s ease;
}

.delete-btn:hover {
    background: #c82333;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .balance-info {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        justify-content: center;
    }
    
    .record-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .record-details {
        text-align: left;
    }
    
    .delete-btn {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* Scrollbar Styling */
.records-list::-webkit-scrollbar {
    width: 8px;
}

.records-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.records-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.records-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Header Top Section */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-top h1 {
    margin-bottom: 0;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.login-btn {
    background: #28a745;
    color: white;
}

.login-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.register-btn {
    background: #007bff;
    color: white;
}

.register-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.logout-btn {
    background: #dc3545;
    color: white;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.auth-form {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-footer {
    padding: 20px 25px 25px 25px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.modal-footer p {
    margin: 0;
    color: #666;
}

.modal-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.modal-footer a:hover {
    color: #764ba2;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .auth-buttons {
        justify-content: center;
    }
}

/* User Info Styles */
.user-info {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-info i {
    color: #fff;
}

.user-info span {
    color: white;
}

/* Login Prompt Styles */
.login-prompt {
    text-align: center;
    padding: 40px 20px;
}

.login-prompt .empty-state {
    color: #666;
}

.login-prompt .empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ccc;
}

.login-prompt .submit-btn {
    margin-top: 20px;
    width: auto;
    min-width: 200px;
}
