* {
    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;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    gap: 20px;
}

section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

h3 {
    color: #555;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* Input Groups */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 12px;
    color: #667eea;
    font-weight: 700;
    font-size: 1.1rem;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 12px 12px 12px 35px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"] {
    padding-left: 12px;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
    background: #4CAF50;
    color: white;
}

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

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
    transform: translateY(-2px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Summary Cards */
.summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
}

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

.balance-card {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
}

.balance-card.alert {
    background: linear-gradient(135deg, #ff9a9e 0%, #fab1a0 100%);
    border-left-color: #f44336;
}

.summary-card h3 {
    margin-bottom: 12px;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
}

#balance-amount.alert-text-red {
    color: #f44336;
}

/* Expenses List */
.expenses-list-section {
    margin-top: 20px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.1rem;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #667eea;
    margin-bottom: 12px;
    border-radius: 6px;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.expense-item:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.expense-info {
    flex: 1;
}

.expense-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 1rem;
}

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

.expense-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #da190b;
    transform: scale(1.1);
}

/* Currency Selector */
.currency-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.currency-controls label {
    margin: 0;
    font-weight: 600;
}

.currency-controls select {
    padding: 10px 15px;
    min-width: 150px;
}

@media (max-width: 600px) {
    .currency-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Chart Section */
.chart-section {
    margin-top: 30px;
}

#balance-chart {
    max-width: 400px;
    margin: 0 auto;
}

/* Actions Section */
.actions-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.actions-section .btn {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 600px) {
    .actions-section {
        flex-direction: column;
    }

    .actions-section .btn {
        width: 100%;
    }
}

/* Budget Alert */
.budget-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fab1a0 100%);
    color: #d32f2f;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    animation: slideDownIn 0.5s ease;
    z-index: 1000;
    max-width: 350px;
}

@keyframes slideDownIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.budget-alert.hidden {
    display: none;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-text {
    flex: 1;
    font-size: 0.95rem;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #d32f2f;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.alert-close:hover {
    transform: scale(1.2);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .summary-value {
        font-size: 1.5rem;
    }

    .budget-alert {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Grid */
.summary-section {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 1024px) {
    .summary-section {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .summary-section {
        grid-template-columns: 1fr;
    }

    .expense-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .expense-actions {
        width: 100%;
        margin-top: 10px;
    }

    .delete-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Expense Date Display */
.expense-date-info {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 8px;
}
/* Date Filter Section */
.date-filter-section {
    margin-top: 20px;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 10px 18px;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.filter-group input[type="date"] {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 600px) {
    .filter-group {
        flex-direction: column;
    }

    .filter-group input[type="date"] {
        width: 100%;
    }
}

/* Daily Summary Section */
.daily-summary-section {
    margin-top: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.daily-card, .monthly-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.daily-card:hover, .monthly-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.daily-date, .monthly-date {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.daily-total, .monthly-total {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

/* Monthly Summary Section */
.monthly-summary-section {
    margin-top: 20px;
}

.monthly-card {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.monthly-card:hover {
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

/* Enhanced Expense Item */
.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.expense-category {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expense-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 8px;
}

.expense-date {
    display: inline-block;
}

@media (max-width: 600px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}