:root {
    --primary-color: #4a6bff;
    --secondary-color: #6c5ce7;
    --danger-color: #ff5252;
    --success-color: #00b894;
    --text-color: #2d3436;
    --light-gray: #f5f6fa;
    --medium-gray: #dfe6e9;
    --dark-gray: #636e72;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 400px;
    margin: 50px auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.auth-card h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.auth-card h2 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.auth-card p {
    margin-bottom: 20px;
    color: var(--dark-gray);
}

input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 16px;
}

button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #3a56e8;
}

.toggle-auth {
    margin-top: 15px;
    font-size: 14px;
}

.toggle-auth a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

/* App Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--primary-color);
}

#logout-btn {
    width: auto;
    padding: 8px 15px;
    background-color: var(--danger-color);
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-section, .chart-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

h2 {
    margin-bottom: 20px;
    color: var(--text-color);
}

#expense-form input, 
#expense-form select {
    margin-bottom: 15px;
}

.recent-expenses {
    margin-top: 30px;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--medium-gray);
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-value {
    font-weight: bold;
    color: var(--danger-color);
}

.chart-container {
    margin: 20px 0;
    height: 300px;
}

#analyze-btn {
    margin-top: 20px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#analyze-btn:hover {
    background-color: #5a4ad8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-gray);
}

.ai-response {
    margin-top: 20px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}