* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #667eea;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.header {
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
}

.content {
    padding: 30px;
}

.input-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.message {
    background: #ef4444;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    display: none;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 1.1em;
}

input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.3em;
    transition: border 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 20px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
}

.results {
    display: none;
}

.results.show {
    display: block;
}

.category {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.category:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.category-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
}

.category-percentage {
    font-size: 1.5em;
    font-weight: 700;
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
}

.needs .category-percentage {
    background: #10b981;
}

.wants .category-percentage {
    background: #f59e0b;
}

.savings .category-percentage {
    background: #3b82f6;
}

.category-amount {
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.category-description {
    color: #666;
    line-height: 1.6;
}

.expense-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.type-selector {
    display: flex;
    gap: 5px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.type-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background-color: #e0e0e0;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
}

.type-btn.active {
    background-color: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.type-btn:hover:not(.active) {
    background-color: #d0d0d0;
}

.add-btn {
    padding: 15px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1em;
    white-space: nowrap;
}

.add-btn:hover {
    background: #5568d3;
}

.expense-list {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    font-weight: bold;
}

.expense-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.expense-item button {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(239,68,68,0.3);
}

.expense-item button:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(239,68,68,0.4);
}

.expense-item.expense {
    border-left: 4px solid #ef4444;
    color: #dc2626;
}

.expense-item.income {
    border-left: 4px solid #10b981;
    color: #059669;
}


.summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.summary h3 {
    margin: 0;
    color: #333;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
}
/* 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-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close-btn {
    font-size: 2em;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.save-btn, .cancel-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn {
    background: #10b981;
    color: white;
}

.save-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.cancel-btn {
    background: #ef4444;
    color: white;
}

.cancel-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.delete-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #ef4444;
    color: white;
}

.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.config-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 20px;
}

.config-btn:hover {
    transform: translateY(-2px);
}

.clear-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 20px;
}

.clear-btn:hover {
    transform: translateY(-2px);
}

.clear-btn.small {
    width: auto;
    padding: 8px 12px;
    font-size: 0.9em;
}

.reminders-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.reminders-section h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.reminder-group {
    margin-bottom: 15px;
}

.reminder-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 1.1em;
}

.reminder-group textarea {
    width: 100%;
    min-height: 80px;
    padding: 15px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border 0.3s;
}

.reminder-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 100%;
        margin: 0;
    }
    body {
        padding: 0;
    }
    .content {
        padding: 15px;
    }
    .input-section {
        padding: 15px;
    }
    .header {
        padding: 20px;
    }
}