/* Reset and base styles */
* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header */
header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 30px;
    text-align: center;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

header h1 i {
    margin-right: 15px;
    color: #fff;
}

.total-display {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.total-label {
    font-size: 1.1rem;
    margin-right: 10px;
    opacity: 0.9;
}

.total-amount {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form section */
.form-section {
    padding: 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.form-section h2 {
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 600;
}

.expense-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    align-items: end;
}

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

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
    transform: translateY(-2px);
}

.error-message {
    color: #e53e3e;
    font-size: 0.8rem;
    margin-top: 5px;
    min-height: 20px;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

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

/* Filter section */
.filter-section {
    padding: 30px 40px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.filter-section h3 {
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 1.4rem;
    font-weight: 600;
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-controls select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-controls select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.btn-secondary {
    background: #718096;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
}

/* Expenses section */
.expenses-section {
    padding: 40px;
    background: #fff;
}

.expenses-section h3 {
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 600;
}

.expenses-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.expense-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.expense-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.25);
}

.expense-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.expense-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    flex-grow: 1;
}

.expense-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #00f2fe;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.expense-date {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.delete-btn {
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    margin-left: auto;
}

.delete-btn:hover {
    background: #e53e3e;
    transform: scale(1.05);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state span {
    font-size: 1rem;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .total-amount {
        font-size: 1.5rem;
    }
    
    .form-section,
    .expenses-section {
        padding: 20px;
    }
    
    .filter-section {
        padding: 20px;
    }
    
    .expense-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls select,
    .btn-secondary {
        width: 100%;
    }
    
    .expenses-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .expense-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .form-section h2,
    .expenses-section h3 {
        font-size: 1.4rem;
    }
    
    .expense-title {
        font-size: 1.1rem;
    }
    
    .expense-amount {
        font-size: 1.5rem;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .empty-state p {
        font-size: 1.2rem;
    }
}

/* Animation for new expenses */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.expense-card.new {
    animation: slideInUp 0.5s ease-out;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
