/**
 * Budget Planner Custom Styles
 * Complements Tailwind CSS with custom styling
 */

/* Root Variables */
:root {
    --primary-blue: #2563eb;
    --light-blue: #3b82f6;
    --yellow-cream: #fef3c7;
    --yellow-border: #fbbf24;
    --green-success: #10b981;
    --red-danger: #ef4444;
    --gray-light: #f3f4f6;
    --gray-border: #d1d5db;
    --text-dark: #1f2937;
}

/* Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f9fafb;
}

/* Header Styles */
.budget-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Category Section Headers */
.category-header {
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-weight: 600;
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Budget Item Row */
.budget-row {
    background: var(--yellow-cream);
    border-left: 3px solid var(--yellow-border);
    transition: all 0.2s ease;
}

.budget-row:hover {
    background: #fde68a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Input Styles */
.budget-input {
    border: 1px solid var(--gray-border);
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.budget-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.budget-input:disabled {
    background-color: var(--gray-light);
    cursor: not-allowed;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--green-success);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.progress-fill.over-budget {
    background: var(--red-danger);
}

/* Progress Percentage Text */
.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Left Amount Display */
.left-display {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.left-display.negative {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.left-amount {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-success {
    background: var(--green-success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-danger {
    background: var(--red-danger);
    color: white;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Category Section */
.category-section {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

/* Summary Cards */
.summary-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-blue);
}

.summary-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.summary-amount {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Month Selector */
.month-selector {
    padding: 0.75rem 1rem;
    border: 2px solid var(--primary-blue);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.month-selector:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--green-success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--red-danger);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-blue);
}

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

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

    .budget-row {
        padding: 0.75rem;
    }

    .category-header {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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