/* Process Cost Calculator - Delightful Stepper UI */

/* Base Layout */
.calculator-page {
    background: var(--bg-darkest);
    min-height: 100vh;
}

.calculator-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 96px; /* navbar height + progress bar clearance */
}

.calculator-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 88px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-dark);
    z-index: 100;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--color-primary);
}

/* Live Preview */
.live-preview {
    position: fixed;
    top: 103px;
    right: var(--space-6);
    background: var(--bg-card);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-medium);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 99;
}

.live-preview.visible {
    opacity: 1;
    transform: translateY(0);
}

.preview-label {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.preview-amount {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

/* Step Sections */
.calc-step {
    display: none;
    width: 100%;
    max-width: 600px;
}

.calc-step.active {
    display: block;
    animation: stepIn 0.4s ease-out;
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.calc-step.exit {
    animation: stepOut 0.3s ease-in forwards;
}

@keyframes stepOut {
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Step Content */
.step-content {
    text-align: center;
}

.step-number {
    display: inline-block;
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    margin-bottom: var(--space-4);
}

.step-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    line-height: var(--line-height-tight);
}

.step-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-tertiary);
    margin-bottom: var(--space-8);
}

/* Step Input */
.step-input {
    margin-bottom: var(--space-8);
}

/* Big Text Input */
.big-input {
    width: 100%;
    padding: var(--space-5);
    background: var(--bg-card);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: var(--font-size-2xl);
    font-family: inherit;
    text-align: center;
    transition: all 0.3s ease;
}

.big-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

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

/* Slider Styles */
.slider-container {
    padding: var(--space-6) 0;
}

.styled-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.styled-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
}

.styled-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 50%;
    cursor: grab;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.slider-value {
    margin-top: var(--space-5);
}

.slider-value span:first-child {
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-black);
    color: var(--color-primary);
    line-height: 1;
}

.slider-unit {
    display: block;
    font-size: var(--font-size-lg);
    color: var(--text-tertiary);
    margin-top: var(--space-2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-2);
}

/* People Selector */
.people-selector {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

.people-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-medium);
    color: var(--text-secondary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.people-btn:hover {
    border-color: var(--color-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.people-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-color: var(--color-primary);
    color: var(--bg-darkest);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

/* Salary Options */
.salary-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
    margin: 0 auto;
}

.salary-btn {
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.salary-btn:hover {
    border-color: var(--color-primary);
    transform: translateX(4px);
}

.salary-btn.active {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--color-primary);
}

.salary-range {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.salary-btn.active .salary-range {
    color: var(--color-primary);
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.btn-next, .btn-calculate {
    min-width: 200px;
}

.btn-back {
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: var(--font-size-base);
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.btn-skip {
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-skip:hover {
    color: var(--text-secondary);
}

/* Keyboard Hint */
.keyboard-hint {
    margin-top: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.keyboard-hint kbd {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--font-size-xs);
}

/* Loading State */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-animation {
    margin-bottom: var(--space-6);
}

.loading-icon {
    width: 120px;
    height: 120px;
    color: var(--color-primary);
}

.calculator-icon {
    width: 100%;
    height: 100%;
}

.calc-dot {
    animation: calcPulse 1.5s ease-in-out infinite;
}

.calc-dot.d1 { animation-delay: 0s; }
.calc-dot.d2 { animation-delay: 0.1s; }
.calc-dot.d3 { animation-delay: 0.2s; }
.calc-dot.d4 { animation-delay: 0.3s; }
.calc-dot.d5 { animation-delay: 0.4s; }
.calc-dot.d6 { animation-delay: 0.5s; }

@keyframes calcPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.calc-equals {
    animation: calcEquals 1.5s ease-in-out infinite;
}

@keyframes calcEquals {
    0%, 100% { opacity: 0.3; }
    70%, 90% { opacity: 1; }
}

.loading-text {
    font-size: var(--font-size-2xl);
    color: var(--text-secondary);
    font-weight: var(--font-weight-light);
}

/* Results */
.results-content {
    max-width: 700px;
    margin: 0 auto;
}

.results-intro {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    display: block;
    margin-bottom: var(--space-4);
}

.results-intro span {
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
}

.big-number-container {
    margin-bottom: var(--space-4);
}

.big-number {
    font-size: clamp(3rem, 15vw, 7rem);
    font-weight: var(--font-weight-black);
    color: var(--color-primary);
    line-height: 1;
    display: block;
    font-variant-numeric: tabular-nums;
}

.per-year {
    font-size: var(--font-size-2xl);
    color: var(--text-tertiary);
    font-weight: var(--font-weight-light);
}

.monthly-breakdown {
    font-size: var(--font-size-lg);
    color: var(--text-tertiary);
    margin-bottom: var(--space-8);
}

.monthly-breakdown strong {
    color: var(--text-primary);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.result-card {
    background: var(--bg-card);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-medium);
}

.result-card.highlight {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.05);
}

.result-card-value {
    display: block;
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

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

.result-card-label {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

/* Results Insight */
.results-insight {
    background: rgba(255, 215, 0, 0.05);
    border-left: 4px solid var(--color-primary);
    padding: var(--space-5);
    margin-bottom: var(--space-8);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    text-align: left;
}

.results-insight h4 {
    color: var(--color-primary);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
}

.results-insight p {
    color: var(--text-secondary);
    margin: 0;
    line-height: var(--line-height-relaxed);
}

/* Results CTA */
.results-cta {
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-medium);
}

.results-cta p {
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.results-cta .btn-primary {
    margin-bottom: var(--space-4);
}

.btn-restart {
    display: block;
    margin: 0 auto;
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-restart:hover {
    color: var(--text-secondary);
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Responsive */
@media (max-width: 768px) {
    .step-title {
        font-size: var(--font-size-3xl);
    }

    .step-subtitle {
        font-size: var(--font-size-base);
    }

    .big-input {
        font-size: var(--font-size-xl);
        padding: var(--space-4);
    }

    .slider-value span:first-child {
        font-size: var(--font-size-5xl);
    }

    .people-btn {
        width: 56px;
        height: 56px;
        font-size: var(--font-size-lg);
    }

    .live-preview {
        top: auto;
        bottom: var(--space-4);
        right: 50%;
        transform: translateX(50%) translateY(10px);
    }

    .live-preview.visible {
        transform: translateX(50%) translateY(0);
    }

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

    .keyboard-hint {
        display: none;
    }
}

@media (max-width: 480px) {
    .calculator-wrapper {
        padding: var(--space-4);
    }

    .step-title {
        font-size: var(--font-size-2xl);
    }

    .salary-btn {
        padding: var(--space-3) var(--space-4);
    }

    .salary-range {
        font-size: var(--font-size-base);
    }
}

/* Animations for results reveal */
.results-content .results-intro,
.results-content .big-number-container,
.results-content .monthly-breakdown,
.results-content .results-grid,
.results-content .results-insight,
.results-content .results-cta {
    opacity: 0;
    transform: translateY(20px);
}

.calc-step[data-step="results"].active .results-intro {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.1s;
}

.calc-step[data-step="results"].active .big-number-container {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.2s;
}

.calc-step[data-step="results"].active .monthly-breakdown {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.4s;
}

.calc-step[data-step="results"].active .results-grid {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.6s;
}

.calc-step[data-step="results"].active .results-insight {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.8s;
}

.calc-step[data-step="results"].active .results-cta {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 1s;
}

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