* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2D3748;
    --secondary-color: #4A5568;
    --accent-color: #667EEA;
    --success-color: #48BB78;
    --background: #F7FAFC;
    --card-background: #FFFFFF;
    --text-primary: #1A202C;
    --text-secondary: #718096;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

/* Dashboard */
.dashboard {
    padding-top: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

/* Dashboard Summary Section */
.dashboard-summary {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.dashboard-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.summary-item.clickable {
    cursor: pointer;
}

.summary-item.clickable:hover {
    background: var(--card-background);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.summary-item.highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

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

.summary-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.summary-amount.income {
    color: var(--success-color);
}

.summary-amount.expense {
    color: var(--secondary-color);
}

.summary-breakdown {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

/* Next Goal Compact */
.next-goal-compact {
    background: var(--gradient);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.next-goal-info {
    flex: 1;
}

.next-goal-label {
    font-size: 0.75rem;
    letter-spacing: 1px;
    opacity: 0.9;
    font-weight: 600;
}

.next-goal-info h3 {
    font-size: 1.5rem;
    margin: 0.5rem 0 1rem;
    color: white;
}

.next-goal-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.stat-value.highlight {
    color: #FBD38D;
}

.stat-value.accent {
    color: #FCA5A5;
}

.next-goal-progress-compact {
    flex-shrink: 0;
}

.progress-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255, 255, 255, 0.4);
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Goals Section Compact */
.goals-section-compact {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.goals-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.goal-card-compact {
    background: var(--card-background);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

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

.goal-card-compact.achieved {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.05) 0%, rgba(56, 161, 105, 0.05) 100%);
}

.goal-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.goal-tier-compact {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-status-compact {
    font-size: 1rem;
}

.goal-card-compact h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.goal-amount-compact {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.goal-card-compact.achieved .goal-amount-compact {
    color: var(--success-color);
}

.goal-investment-compact {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.investment-row-compact {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.investment-row-compact:last-child {
    margin-bottom: 0;
}

.investment-label-compact {
    color: var(--text-secondary);
    font-weight: 500;
}

.investment-value-compact {
    font-weight: 700;
    color: var(--accent-color);
}

.investment-value-compact.additional {
    color: var(--success-color);
}

.goal-progress-compact {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.goal-progress-fill-compact {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.goal-card-compact.achieved .goal-progress-fill-compact {
    background: var(--success-color);
}

.goal-progress-text-compact {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Dashboard Actions */
.dashboard-actions {
    text-align: center;
    padding: 0.5rem 0;
}

/* Old Dashboard Styles - Keep for backward compatibility but override */
.next-goal-section {
    display: none;
}

.all-goals-section {
    display: none;
}

/* Landing Page Styles */
.landing-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.landing-hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-background);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 4rem;
}

.landing-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 1.375rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.landing-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--background);
    border-radius: 50px;
    font-weight: 500;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-pill:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-pill-link {
    color: var(--text-primary);
    cursor: pointer;
}

.feature-pill-link:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.feature-icon {
    font-size: 1.25rem;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

.btn-cta-pulse {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
        transform: scale(1.02);
    }
}

.btn-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
    animation: none;
}

.cta-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.btn-cta:hover .cta-arrow {
    transform: translateX(4px);
}

.landing-note {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

.scroll-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.scroll-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(10px);
    }
}

/* Dashboard Preview Section */
.landing-dashboard-preview {
    text-align: center;
    margin: 5rem 0;
    padding: 0 1rem;
}

.landing-dashboard-preview h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.preview-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-screenshot-container {
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-screenshot-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.15);
}

.dashboard-screenshot {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .landing-dashboard-preview h2 {
        font-size: 2rem;
    }

    .preview-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .dashboard-screenshot-container {
        border-radius: 12px;
    }
}

.landing-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.benefit-card {
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    text-align: center;
}

.benefit-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.benefit-card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.benefit-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.benefit-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.landing-how-it-works {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--background);
    border-radius: 24px;
    margin-bottom: 4rem;
}

.landing-how-it-works h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.steps-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.step-preview-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.step-preview-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

.step-preview-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.step-preview-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.landing-cta-section {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-background);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
}

.landing-cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.landing-cta-section p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.blog-cta-card {
    margin-top: 2.5rem;
    text-align: center;
}

.blog-cta-content p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.blog-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.2s;
}

.blog-cta-link:hover {
    gap: 0.75rem;
    color: #764ba2;
}

@media (max-width: 768px) {
    .blog-cta-card {
        text-align: center;
    }

    .blog-cta-icon {
        font-size: 2.5rem;
    }
}

.landing-keywords {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
}

.keywords-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

.keywords-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-background);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 12.5%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

/* Steps */
.step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-background);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Icons */
.icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.icon-large {
    width: 80px;
    height: 80px;
    color: var(--accent-color);
}

/* Explanation Box */
.explanation-box {
    margin: 2rem 0;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
    margin: 2rem 0;
}

.highlight-box h3 {
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.benefit-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--background);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.benefit-item:hover {
    transform: translateY(-4px);
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.benefit-item h4 {
    margin-bottom: 0.5rem;
}

.benefit-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.step-content>.btn-primary {
    display: block;
    margin: 2rem auto 0;
}

/* Input Fields */
.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.input-field {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-color);
}

.input-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.ticker-input-row,
.rental-input-row,
.other-input-row,
.expense-input-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
}

/* Retirement accounts input row */
.retirement-input-section .input-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Lists */
.ticker-list,
.income-list,
.expense-list {
    margin: 1.5rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.list-item:hover {
    background: var(--border-color);
}

.list-item-info {
    flex: 1;
}

.list-item-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.list-item-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.list-item-value {
    font-weight: 600;
    color: var(--accent-color);
    margin-right: 1rem;
}

.delete-btn {
    background: transparent;
    border: none;
    color: #E53E3E;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    transition: transform 0.2s ease;
}

.delete-btn:hover {
    transform: scale(1.2);
}

/* Blended Yield Box */
.blended-yield-box {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 161, 105, 0.1) 100%);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
    border-left: 4px solid var(--success-color);
}

.yield-display {
    margin: 1.5rem 0;
    display: flex;
    justify-content: space-around;
    gap: 2rem;
}

.yield-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.yield-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.yield-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--success-color);
}

.yield-explanation {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.income-highlight {
    color: var(--accent-color);
}

/* Total Box */
.total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: var(--background);
    border-radius: 8px;
    margin-top: 1.5rem;
    font-weight: 600;
}

.total-value {
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* Calculating Container */
.calculating-container {
    text-align: center;
    padding: 3rem 0;
    min-height: 550px;
}

.calculating-steps {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
    min-height: 250px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

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

.calculating-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.calc-step {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.calc-step:nth-child(1) {
    animation-delay: 0.5s;
}

.calc-step:nth-child(2) {
    animation-delay: 1s;
}

.calc-step:nth-child(3) {
    animation-delay: 1.5s;
}

.calc-step:nth-child(4) {
    animation-delay: 2s;
}

/* Congratulations */
.congrats-container {
    text-align: center;
    padding: 2rem 0;
}

.congrats-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.congrats-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.summary-card {
    background: var(--background);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.summary-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.summary-sublabel {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Dashboard */
.dashboard {
    padding-top: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

/* Dashboard Summary Section */
.dashboard-summary {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.dashboard-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.summary-item.clickable {
    cursor: pointer;
}

.summary-item.clickable:hover {
    background: var(--card-background);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.summary-item.highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

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

.summary-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.summary-amount.income {
    color: var(--success-color);
}

.summary-amount.expense {
    color: var(--secondary-color);
}

.summary-breakdown {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

/* Next Goal Compact */
.next-goal-compact {
    background: var(--gradient);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.next-goal-info {
    flex: 1;
}

.next-goal-label {
    font-size: 0.75rem;
    letter-spacing: 1px;
    opacity: 0.9;
    font-weight: 600;
}

.next-goal-info h3 {
    font-size: 1.5rem;
    margin: 0.5rem 0 1rem;
    color: white;
}

.next-goal-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.stat-value.highlight {
    color: #FBD38D;
}

.stat-value.accent {
    color: #FCA5A5;
}

.next-goal-progress-compact {
    flex-shrink: 0;
}

.progress-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255, 255, 255, 0.4);
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Goals Section Compact */
.goals-section-compact {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.goals-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.goal-card-compact {
    background: var(--card-background);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

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

.goal-card-compact.achieved {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.05) 0%, rgba(56, 161, 105, 0.05) 100%);
}

.goal-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.goal-tier-compact {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-status-compact {
    font-size: 1rem;
}

.goal-card-compact h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.goal-amount-compact {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.goal-card-compact.achieved .goal-amount-compact {
    color: var(--success-color);
}

.goal-investment-compact {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.investment-row-compact {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.investment-row-compact:last-child {
    margin-bottom: 0;
}

.investment-label-compact {
    color: var(--text-secondary);
    font-weight: 500;
}

.investment-value-compact {
    font-weight: 700;
    color: var(--accent-color);
}

.investment-value-compact.additional {
    color: var(--success-color);
}

.goal-progress-compact {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.goal-progress-fill-compact {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.goal-card-compact.achieved .goal-progress-fill-compact {
    background: var(--success-color);
}

.goal-progress-text-compact {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Dashboard Actions */
.dashboard-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.signup-banner-dashboard {
    background: linear-gradient(135deg, rgba(251, 211, 141, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    border: 2px solid #FBD38D;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0 1rem 0;
}

.signup-banner-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.signup-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.signup-banner-text h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.signup-banner-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.signup-banner-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-start;
}

.btn-primary-small {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-primary-small:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-text-small {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.5rem;
}

.btn-text-small:hover {
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .step-content {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .ticker-input-row,
    .rental-input-row,
    .other-input-row,
    .expense-input-row {
        grid-template-columns: 1fr;
    }

    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .goal-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .goals-grid {
        grid-template-columns: 1fr;
    }

    .dashboard {
        height: auto;
    }

    .next-goal-section {
        flex: none;
    }

    .all-goals-section {
        overflow-y: visible;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Footer */
.blog-footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    color: var(--text-secondary);
}

.footer-tagline {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

/* Goal Investment Needed */
.goal-investment-needed {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.investment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.investment-row.additional {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

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

.investment-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-color);
}

.investment-value.highlight {
    color: var(--success-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-background);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--text-primary);
    background: var(--background);
}

.tab-button.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Income Modal Specific Styles */
#incomeEditModal .modal-content {
    max-width: 800px;
}

/* FIRE Modal Specific Styles */
#fireExplanationModal .modal-content {
    max-width: 700px;
}

/* FI Year Modal Specific Styles */
#fiYearExplanationModal .modal-content {
    max-width: 700px;
}

.fire-explanation {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.fire-intro {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.fire-intro p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.fire-calculation {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.fire-calculation h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.calculation-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calc-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.step-label {
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
}

.step-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.step-value.highlight {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
}

.fire-explanation-text {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.fire-explanation-text h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.fire-explanation-text p {
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

.fire-explanation-text span {
    font-weight: 600;
    color: var(--primary-color);
}

.fire-progress {
    margin-top: 1.5rem;
}

.fire-progress h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.progress-item:last-child {
    border-bottom: none;
    font-weight: 600;
}

.progress-item span:first-child {
    color: var(--text-secondary);
}

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

.fire-customization {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
}

.customization-note p {
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
}

.customization-note p:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.customization-note p:last-of-type {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.customization-note button {
    margin-top: 0.5rem;
}

.customization-note button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.add-income-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.add-income-row .input-field {
    flex: 1;
    margin: 0;
}

.add-income-row .btn-secondary {
    flex-shrink: 0;
    white-space: nowrap;
}

.income-edit-list {
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.expense-edit-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.expense-edit-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.expense-edit-item input[type="text"] {
    flex: 2;
}

.expense-edit-item input[type="number"] {
    flex: 1;
}

.expense-edit-item button {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.expense-edit-item button:hover {
    background: #fee;
    border-color: #f44;
    color: #f44;
}

.add-expense-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 2px dashed var(--border-color);
}

.add-expense-row input {
    flex: 1;
}

.add-expense-row button {
    white-space: nowrap;
}

/* Income Edit Item Styles */
.stock-edit-item,
.rental-edit-item,
.other-edit-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.stock-edit-item:hover,
.rental-edit-item:hover,
.other-edit-item:hover {
    background: var(--border-color);
}

.stock-edit-item .input-field,
.rental-edit-item .input-field,
.other-edit-item .input-field {
    flex: 1;
    margin: 0;
}

.stock-edit-item button,
.rental-edit-item button,
.other-edit-item button {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #E53E3E;
    color: #E53E3E;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.stock-edit-item button:hover,
.rental-edit-item button:hover,
.other-edit-item button:hover {
    background: #E53E3E;
    color: white;
}

.stock-yield,
.stock-income {
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    background: var(--background);
    border-radius: 6px;
    color: var(--text-secondary);
}

.stock-yield {
    color: var(--success-color);
    min-width: 60px;
    text-align: center;
}

.stock-income {
    color: var(--accent-color);
    min-width: 90px;
    text-align: right;
}

.step.active {
    display: block;
}

/* AI Chatbot Widget */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 285px;
    max-height: 450px;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.chatbot-container.minimized {
    max-height: 60px;
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.chatbot-icon {
    font-size: 1.25rem;
}

.chatbot-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chatbot-body {
    display: flex;
    flex-direction: column;
    height: 405px;
    overflow: hidden;
    opacity: 1;
    max-height: 405px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.chatbot-container.minimized .chatbot-body {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.chatbot-message {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 0.95rem;
}

.bot-message .message-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
    align-self: flex-start;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
}

.chatbot-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--background);
}

.chatbot-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    background: var(--card-background);
    color: var(--text-primary);
}

.chatbot-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-send {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.chatbot-send:active {
    transform: scale(0.95);
}

/* Responsive chatbot */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        max-width: 285px;
        bottom: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        max-height: 400px;
    }

    .chatbot-body {
        height: 340px;
    }
}

/* KaTeX Math Rendering */
.message-content .katex-display {
    margin: 1em 0;
    text-align: center;
}

.message-content .katex {
    font-size: 1.1em;
    line-height: 1.5;
}

.message-content .katex-display>.katex {
    display: inline-block;
    text-align: center;
}

/* Step 1: Income Form Styles */
.income-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.income-frequency-toggle {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.frequency-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.frequency-btn:hover {
    border-color: var(--accent-color);
    background: rgba(102, 126, 234, 0.05);
}

.frequency-btn.active {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Step 3: House Tracking Styles */
.house-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.house-form-card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.house-form-card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option:has(input:checked) {
    color: var(--accent-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    border-color: var(--accent-color);
    background: rgba(102, 126, 234, 0.1);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.field-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.house-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.house-item {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.house-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}

.house-details {
    flex: 1;
}

.house-details h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.house-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
}

.house-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.house-meta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.house-meta-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.house-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove {
    padding: 0.5rem 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.summary-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Optimization Sections */
.optimization-sections {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex: 1;
    min-height: 300px;
}

.optimization-card {
    flex: 1;
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.optimization-title {
    font-size: 1.1rem;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.optimization-card .numbers-toggle {
    margin: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.optimization-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.optimization-content .chart-container {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

.optimization-content .chart-container canvas {
    max-height: 250px;
}

/* AI Tip Section */
.ai-tip-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.ai-tip-text-wrapper {
    flex: 1;
}

.ai-tip-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-tip-refresh {
    /* Icon-only pill with two icons */
    padding: 0.55rem 0.9rem;
    font-size: 1.1rem;
    /* slightly larger to read both icons */
    line-height: 1;
    width: 64px;
    /* wider button */
    height: 48px;
    /* keep circular feel */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    /* space between ✨ and ↻ */
    border-radius: 9999px;
    border: none;
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #22d3ee 100%);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer sweep */
.btn-tip-refresh::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
    transform: translateX(-120%);
    animation: shimmer 2.2s infinite;
}

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

    100% {
        transform: translateX(120%);
    }
}


.btn-tip-refresh:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.32);
}

.btn-tip-refresh:active {
    transform: translateY(0) scale(0.98);
}

.ai-tip-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-tip-text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 400;
}

.btn-chat-ai {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-chat-ai:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.app-loading .container {
    visibility: hidden;
}