* {
    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: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

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

main {
    padding: 40px 20px;
}

/* Form Section */
.form-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.form-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 1rem;
}

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

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

.input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 35px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

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

.expense-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 2px solid #e0e0e0;
}

.expense-form h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Buttons */
.btn-primary,
.btn-danger {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

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

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

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

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 320px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
}

.btn-danger::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-danger:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(231, 76, 60, 0.35);
}

.btn-danger:hover::before {
    width: 300px;
    height: 300px;
}

.btn-danger:active {
    transform: translateY(-2px) scale(0.98);
}

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

.summary-card {
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.expenses-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.balance-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.summary-card h3 {
    font-size: 0.95rem;
    margin-bottom: 15px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-card .amount {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

/* Expenses Section */
.expenses-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.expenses-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expense-item {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
    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);
    }
}

.expense-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.expense-info {
    flex: 1;
}

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

.expense-amount {
    color: #667eea;
    font-weight: 700;
    font-size: 1.1rem;
}

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

.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    
}

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

.delete-btn:active {
    transform: scale(0.95);
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* Chart Section */
.chart-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.chart-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 500px;
    margin: 0 auto;
}

#balanceChart {
    max-width: 100%;
}

/* Currency Converter Section */
.converter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.converter-section label {
    color: white;
    font-weight: 600;
    margin: 0;
}

.currency-select {
    flex: 1;
    max-width: 300px;
    padding: 10px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.currency-select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.currency-select:hover {
    background: white;
}

/* Budget Alert Section */
.budget-alert {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

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

.alert-icon {
    font-size: 1.5rem;
    animation: pulse 1s infinite;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

#alertMessage {
    flex: 1;
    font-weight: 500;
}

/* Actions Section */
.actions-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8ebf0 100%);
    padding: 40px 30px;
    border-radius: 15px;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #16a34a 100%);
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 320px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
}

.btn-success::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-success:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(39, 174, 96, 0.35);
}

.btn-success:hover::before {
    width: 300px;
    height: 300px;
}

.btn-success:active {
    transform: translateY(-2px) scale(0.98);
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

/* Error Messages */
.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

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

    main {
        padding: 20px;
    }

    .form-section,
    .expenses-section,
    .chart-section {
        padding: 20px;
    }

    .summary-section {
        grid-template-columns: 1fr;
    }

    .summary-card .amount {
        font-size: 1.8rem;
    }

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

    .expense-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .btn-primary,
    .btn-danger {
        width: 100%;
    }

    .btn-success,
    .btn-danger {
        width: 100%;
        min-width: none;
        padding: 14px 20px;
        font-size: 1rem;
    }

    .converter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .currency-select {
        max-width: 100%;
    }

    .actions-section {
        flex-direction: column;
        padding: 30px 20px;
        gap: 15px;
    }

    .budget-alert {
        flex-direction: column;
        text-align: center;
    }
}

/* Input Error State */
input:invalid {
    border-color: #e74c3c;
}

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: successPulse 0.3s ease;
}
