/* ========== SAVINGS GOALS PAGE ========== */

/* Main container */
.savings-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Goal cards */
.goal-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-subtle);
    transition: all 0.3s ease;
}

.goal-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

/* Goal header */
.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.goal-title {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.goal-actions {
    display: flex;
    gap: 8px;
}

.goal-action-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.goal-action-btn:hover {
    background: var(--lavender-floral);
    color: white;
    border-color: var(--lavender-floral);
}

.goal-action-btn.delete {
    color: var(--rose-pompadour);
    border-color: var(--rose-pompadour);
    font-size: 1.2rem;
    padding: 4px 10px;
}

.goal-action-btn.delete:hover {
    background: var(--rose-pompadour);
    color: white;
}

/* Goal info */
.goal-info {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.goal-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.goal-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.goal-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Track indicator */
.track-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.track-indicator.on-track {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.track-indicator.off-track {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

/* Progress bar */
.progress-container {
    margin-bottom: 16px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 12px;
    background: var(--background);
    border-radius: 6px;
    overflow: visible;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lavender-floral), var(--rose-pompadour));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-expected {
    position: absolute;
    top: -4px;
    height: 20px;
    width: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1px;
}

.progress-expected::before {
    content: 'Expected';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-light);
    white-space: nowrap;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: right;
}

/* Contributions section */
.contributions-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.contributions-toggle {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-weight: 500;
    transition: color 0.2s ease;
}

.contributions-toggle:hover {
    color: var(--lavender-floral);
}

.contributions-toggle-icon {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
}

.contributions-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contribution-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--background);
    border-radius: 8px;
    font-size: 0.9rem;
}

.contribution-amount {
    font-weight: 500;
    color: var(--lavender-floral);
}

.contribution-date {
    color: var(--text-light);
    font-size: 0.85rem;
}

.contribution-delete {
    background: none;
    border: none;
    color: var(--rose-pompadour);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.contribution-delete:hover {
    background: rgba(235, 112, 147, 0.1);
}

/* Modal specific styling */
.add-goal-modal-content {
    max-width: 450px;
    padding: 32px !important;
    border-radius: 16px;
}

.add-goal-modal-content .close {
    position: sticky;
    top: 0;
    align-self: flex-end;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    z-index: 10;
    margin-bottom: -10px;
}

.add-goal-modal-content .close:hover {
    color: var(--text-dark);
}

.add-goal-modal-content h2 {
    margin: 0 0 24px 0;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-dark);
    padding-right: 30px;
}

/* Form group spacing */
.add-goal-modal-content .form-group {
    margin-bottom: 16px;
}

.add-goal-modal-content .form-group:last-of-type {
    margin-bottom: 24px;
}

/* Form labels */
.add-goal-modal-content .modal-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Form inputs */
.add-goal-modal-content .form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
}

.add-goal-modal-content .form-input:hover {
    border-color: #c0c0c0;
}

.add-goal-modal-content .form-input:focus {
    outline: none;
    border-color: var(--lavender-floral);
    box-shadow: 0 0 0 3px rgba(180, 145, 222, 0.1);
}

.save-goal-btn {
    width: 100%;
    height: 48px;
    padding: 0 20px;
    background: var(--lavender-floral);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(180, 145, 222, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-goal-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(180, 145, 222, 0.3);
    background: var(--rose-pompadour);
}

.save-goal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .savings-container {
        padding: 15px;
    }

    .goal-card {
        padding: 16px;
    }

    .goal-title {
        font-size: 1.1rem;
    }

    .goal-info {
        gap: 16px;
    }

    .goal-action-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .progress-expected::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .savings-container {
        padding: 10px;
    }

    .goal-card {
        padding: 14px;
    }

    .goal-header {
        flex-direction: column;
        gap: 12px;
    }

    .goal-actions {
        align-self: flex-end;
    }

    .goal-info {
        flex-direction: column;
        gap: 12px;
    }
}
