/* ============= VISUAL ENHANCEMENTS ============= */

/* Improved Typography */
body {
    font-variant-numeric: tabular-nums;
    line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Tabular numbers for better alignment */
.summary-value,
.detail-value,
.kpi-value,
table td {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Enhanced Card Hover Effects */
.detail-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.detail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(91, 99, 245, 0.3),
        0 0 0 1px rgba(91, 99, 245, 0.1);
}

.detail-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(91, 99, 245, 0.4);
}

.detail-card:hover::after {
    opacity: 1;
}

/* Summary Cards Hover */
.summary-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
}

/* Chart Cards Hover */
.chart-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.2);
}

/* Smooth Wizard Step Transitions */
.wizard-step {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-step.active {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Progress Step Transitions */
.progress-step {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step.active .step-number {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Enhanced Loading Skeleton */
.skeleton-loader {
    background: linear-gradient(90deg,
            var(--bg-secondary) 0%,
            var(--bg-tertiary) 50%,
            var(--bg-secondary) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 0.75rem;
}

.skeleton-text:last-child {
    width: 80%;
}

/* Button Hover Enhancements */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Input Focus Enhancements */
.form-control:focus {
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Confetti Container */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f0f;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Results Show Animation */
#results.show {
    animation: resultsAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes resultsAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

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

/* Improved Contrast for Titles */
.section-title,
.detail-header h3,
.modal-header h2,
.tutorial-slide h3 {
    color: var(--text-primary);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .section-title,
[data-theme="dark"] .detail-header h3 {
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Stagger Animation for Cards */
.detail-card {
    animation: staggerIn 0.4s ease-out backwards;
}

.detail-card:nth-child(1) {
    animation-delay: 0.05s;
}

.detail-card:nth-child(2) {
    animation-delay: 0.1s;
}

.detail-card:nth-child(3) {
    animation-delay: 0.15s;
}

.detail-card:nth-child(4) {
    animation-delay: 0.2s;
}

.detail-card:nth-child(5) {
    animation-delay: 0.25s;
}

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

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

/* Micro-interactions for Icons */
.fa,
.fas,
.far {
    transition: transform 0.2s ease;
}

button:hover .fa,
button:hover .fas,
button:hover .far {
    transform: scale(1.1);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced Table Hover */
table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}