/* Savings Goal Calculator Specific Styles */

.page-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.page-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Popular Goals Section */
.popular-goals {
    margin-bottom: var(--spacing-xl);
}

.goals-container {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px var(--shadow);
}

.goals-container h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.goal-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.goal-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.goal-card.emergency {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.goal-card.vacation {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.goal-card.house {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
}

.goal-card.car {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.goal-card.education {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
}

.goal-card.retirement {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.goal-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.goal-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    text-align: center;
    color: #ffffff;
}

.goal-amount {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: #ffffff;
}

.goal-description p {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    text-align: center;
    color: #f1f5f9;
}

.goal-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.goal-description li {
    font-size: 0.875rem;
    color: #e2e8f0;
    margin-bottom: var(--spacing-xs);
    padding-left: var(--spacing-sm);
    position: relative;
}

.goal-description li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #ffffff;
    font-weight: bold;
}

/* Calculator Section */
.calculator-section {
    margin-bottom: var(--spacing-xl);
}

.calculator-container {
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px var(--shadow);
}

.calculator-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.calculator-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.calculator-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Form Styles */
.calculator-form {
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: var(--spacing-xl);
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

.goal-info,
.current-info,
.preferences-info {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.goal-info p,
.current-info p,
.preferences-info p {
    margin: 0;
    color: #0c4a6e;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group small {
    margin-top: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.4;
}

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

.input-prefix {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    z-index: 1;
}

.input-suffix {
    position: absolute;
    right: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    z-index: 1;
}

.input-group .form-input {
    padding-left: 32px;
}

.input-group .form-input:has(+ .input-suffix) {
    padding-right: 32px;
    padding-left: 16px;
}

.form-input {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 16px;
    width: 100%;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

.calculate-btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1.125rem;
    font-weight: 600;
}

/* Results Section */
.savings-goal-results {
    margin-top: var(--spacing-lg);
}

.results-container {
    background: var(--card-bg);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px var(--shadow);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.results-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Savings Overview */
.savings-overview {
    margin-bottom: var(--spacing-xl);
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.overview-card {
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 0 2px 4px var(--shadow);
    transition: all 0.3s ease;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-lg);
}

.overview-card.goal.highlight {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(139, 92, 246, 0.1));
    border-color: #8b5cf6;
    border-left: 4px solid #8b5cf6;
}

.overview-card.current {
    border-left: 4px solid #3b82f6;
}

.overview-card.monthly {
    border-left: 4px solid #10b981;
}

.overview-card.timeline {
    border-left: 4px solid #f59e0b;
}

.overview-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.overview-card.goal.highlight .card-amount {
    color: #8b5cf6;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs);
    background: #f8fafc;
    border-radius: 4px;
    font-size: 0.875rem;
}

.detail-item span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-item span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* Progress Visualization */
.progress-visualization {
    margin-bottom: var(--spacing-xl);
}

.progress-visualization h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-xs);
}

.progress-chart {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.progress-bar-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.progress-bar {
    position: relative;
    height: 40px;
    background: #e5e7eb;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: var(--border-radius);
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-amounts {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Savings Projection */
.savings-projection h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.projection-chart {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.projection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    background: #f8fafc;
    border-radius: 4px;
    font-size: 0.875rem;
}

.projection-month {
    font-weight: 600;
    color: var(--text-primary);
}

.projection-amount {
    font-weight: 600;
    color: #8b5cf6;
}

/* Savings Breakdown */
.savings-breakdown {
    margin-bottom: var(--spacing-xl);
}

.savings-breakdown h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-xs);
}

.breakdown-table {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row.total-row {
    background: rgba(139, 92, 246, 0.05);
    font-weight: 600;
    color: #7c3aed;
}

.period-label {
    font-weight: 600;
    color: var(--text-primary);
}

.table-row span:not(.period-label) {
    text-align: right;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Savings Strategies */
.savings-strategies {
    margin-bottom: var(--spacing-xl);
}

.savings-strategies h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-xs);
}

.strategies-content {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.strategy-item {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.strategy-item:last-child {
    margin-bottom: 0;
}

.strategy-item.high-priority {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.strategy-item.medium-priority {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.strategy-item.low-priority {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.strategy-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.strategy-text {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.875rem;
}

/* Goal Recommendations */
.goal-recommendations h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-xs);
}

.recommendations-content {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.recommendation-item {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.recommendation-item:last-child {
    margin-bottom: 0;
}

.recommendation-item.excellent {
    border-left-color: #10b981;
    background: #d1fae5;
}

.recommendation-item.good {
    border-left-color: #3b82f6;
    background: #dbeafe;
}

.recommendation-item.warning {
    border-left-color: #f59e0b;
    background: #fef3cd;
}

.recommendation-item.critical {
    border-left-color: #ef4444;
    background: #fee2e2;
}

.recommendation-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.recommendation-text {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .goals-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-container,
    .results-container {
        padding: var(--spacing-lg);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-header {
        flex-direction: column;
        text-align: center;
    }
    
    .result-actions {
        justify-content: center;
    }
    
    .progress-container {
        gap: var(--spacing-md);
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    .table-row span:not(.period-label) {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .overview-cards {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .result-actions .btn {
        width: 100%;
    }
    
    .card-amount {
        font-size: 1.5rem;
    }
    
    .detail-item {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    .progress-amounts {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
}
