/* Additional styles specific to the calculator */

/* Readability: ensure minimum font sizes across the site */
body {
    font-size: 1.05rem;
}

small, .small {
    font-size: 0.9rem !important;
}

.text-muted.small, small.text-muted {
    font-size: 0.9rem !important;
}

.text-white {
    color: #fff !important;
}

.calculation-step {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.calculation-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.result-metric {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--primary-orange);
}

.result-metric .value {
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--primary-dark-blue);
}

.result-metric .label {
    font-size: 0.95rem;
    color: var(--grayish-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-level-very-low {
    background-color: #28a745;
}

.risk-level-low {
    background-color: #ffc107;
    color: var(--primary-dark-blue) !important;
}

.risk-level-medium {
    background-color: #fd7e14;
}

.risk-level-high {
    background-color: #dc3545;
}

.recommendation-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary-orange);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

/* Removed pulse animation as requested */

/* Form enhancements */
.form-section {
    border: 1px solid rgba(171, 184, 195, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(174, 222, 248, 0.05);
}

.form-section h5 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-orange);
}

.info-tooltip {
    position: relative;
    cursor: help;
}

.info-tooltip .tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-dark-blue);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
}

.info-tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* Force floating labels to always stay at top */
.form-floating > label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem) !important;
    transform-origin: 0 0 !important;
    opacity: 0.65 !important;
    transition: none !important;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control:placeholder-shown ~ label,
.form-floating > .form-select ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem) !important;
    transform-origin: 0 0 !important;
    opacity: 0.65 !important;
    transition: none !important;
}

/* Ensure placeholder is hidden so label always shows small */
.form-floating > .form-control::placeholder {
    opacity: 0 !important;
}

.form-floating > .form-control:focus::placeholder {
    opacity: 0 !important;
}

/* Input field with integrated info icon */
.input-with-info {
    position: relative;
}

.input-with-info .form-control,
.input-with-info .form-select {
    padding-right: 3rem !important;
}

.input-with-info .info-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: help;
    color: #6c757d;
}

.input-with-info .info-icon:hover {
    color: var(--primary-dark-blue);
}

.input-with-info .tooltip-content {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: var(--primary-dark-blue);
    color: white;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    white-space: normal;
    width: 350px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.input-with-info .tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 15px;
    border: 6px solid transparent;
    border-top-color: var(--primary-dark-blue);
}

.input-with-info .info-icon:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* Border left colored cards for insights */
.border-left-primary {
    border-left: 4px solid var(--primary-dark-blue) !important;
}

.border-left-success {
    border-left: 4px solid #28a745 !important;
}

.border-left-info {
    border-left: 4px solid #17a2b8 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

/* Enhanced tooltip styles for educational content */
.tooltip .tooltip-inner {
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    background-color: #2c3e50;
    font-size: 0.95rem;
    text-align: left;
}

/* Formula display styling */
.formula-display {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin: 0.5rem 0;
}

/* Insights modal custom styling */
.modal-xl {
    max-width: 1200px;
}

/* Modal body customization for insights */
#insightsModal .modal-body {
    padding: 2rem;
    background-color: #f8f9fa;
}

#insightsModal .nav-pills {
    background-color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 48, 91, 0.1);
    margin-bottom: 1.5rem;
}

#insightsModal .tab-content {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 48, 91, 0.1);
    padding: 0;
}

#insightsModal .tab-pane {
    padding: 2rem;
}

/* Enhanced modal tabs styling */
.nav-pills .nav-link {
    border-radius: 0.5rem;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: var(--primary-dark-blue);
    background-color: #f8f9fa;
    border: 2px solid transparent;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
    background-color: var(--light-blue);
    color: var(--primary-dark-blue);
    border-color: var(--primary-dark-blue);
    transform: translateY(-1px);
}

.nav-pills .nav-link.active {
    background-color: var(--primary-dark-blue);
    color: white;
    border-color: var(--primary-dark-blue);
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 48, 91, 0.2);
}

.nav-pills .nav-link.active:hover {
    background-color: var(--primary-dark-blue);
    color: white;
    transform: none;
}

/* Tab content styling */
.tab-content {
    min-height: 400px;
}

/* Small text improvements for better readability */
.small {
    line-height: 1.4;
}

/* Outline button styling */
.btn-outline-primary {
    color: var(--primary-dark-blue);
    border-color: var(--primary-dark-blue);
    background-color: white;
}

.btn-outline-primary:hover {
    background-color: var(--primary-dark-blue);
    border-color: var(--primary-dark-blue);
    color: white;
}

/* Modal header text fix */
.modal-header.bg-primary h1,
.modal-header.bg-primary h2,
.modal-header.bg-primary h3,
.modal-header.bg-primary h4,
.modal-header.bg-primary h5,
.modal-header.bg-primary h6,
.modal-header.bg-primary .modal-title {
    color: white !important;
}

/* Hero section button styling */
.hero-section .btn-outline-primary {
    color: white;
    border-color: white;
    background-color: transparent;
}

.hero-section .btn-outline-primary:hover {
    background-color: white;
    border-color: white;
    color: var(--primary-dark-blue);
}

/* Cookie Banner Styling */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: linear-gradient(135deg, var(--primary-dark-blue) 0%, rgba(0, 48, 91, 0.95) 100%);
    color: white;
    box-shadow: 0 -4px 20px rgba(0, 48, 91, 0.3);
    border-top: 3px solid var(--primary-orange);
}

.cookie-banner-content {
    padding: 1.25rem 0;
}

.cookie-banner-text h6 {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cookie-banner-text p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0;
    opacity: 0.95;
}

.cookie-link {
    color: var(--light-blue);
    text-decoration: underline;
}

.cookie-link:hover {
    color: white;
    text-decoration: underline;
}

.cookie-banner-actions {
    margin-top: 1rem;
}

.cookie-banner .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.7);
    color: white;
    background-color: transparent;
}

.cookie-banner .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
}

.cookie-banner .btn-light {
    background-color: white;
    border-color: white;
    color: var(--primary-dark-blue);
    font-weight: 500;
}

.cookie-banner .btn-light:hover {
    background-color: var(--light-blue);
    border-color: var(--light-blue);
    color: var(--primary-dark-blue);
    transform: translateY(-1px);
}

/* Cookie details modal table styling */
#cookieDetailsModal table {
    font-size: 0.875rem;
}

#cookieDetailsModal code {
    background-color: #f8f9fa;
    color: var(--primary-dark-blue);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* Product recommendation cards */
.product-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 48, 91, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.product-card:hover {
    background: rgba(174, 222, 248, 0.2);
    border-color: var(--primary-dark-blue);
    transform: translateY(-1px);
}

.product-recommendations .fas {
    font-size: 1.2rem;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .form-floating > label {
        font-size: 0.875rem;
        transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem) !important;
    }
    
    .result-metric .value {
        font-size: 1.4rem;
    }
    
    .hero-section {
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .input-with-info .tooltip-content {
        width: 280px;
        right: -50px;
    }
    
    .modal-xl {
        max-width: 95%;
    }
    
    .nav-pills .nav-link {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Cookie banner mobile optimizations */
    .cookie-banner-content {
        padding: 1rem 0;
    }
    
    .cookie-banner-text {
        margin-bottom: 1rem;
    }
    
    .cookie-banner-text h6 {
        font-size: 1rem;
    }
    
    .cookie-banner-text p {
        font-size: 0.85rem;
    }
    
    .cookie-banner-actions {
        margin-top: 0;
        text-align: center;
    }
    
    .cookie-banner .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* ============================================
   Quick Scan Styles
   ============================================ */

/* Result boxes */
.qs-result-box {
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(171, 184, 195, 0.3);
}

/* Locked section card */
.qs-locked-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(171, 184, 195, 0.4);
    background: #fafbfc;
}

.qs-locked-card .qs-locked-overlay {
    position: relative;
    z-index: 2;
    padding: 1rem 0;
}

.qs-locked-content ul li {
    color: var(--primary-dark-blue);
    font-size: 0.95rem;
}

.qs-locked-content ul li i {
    width: 20px;
}

/* Processing state paywall */
.processing-state {
    background: #f8f9fa;
    border: 1px solid rgba(171, 184, 195, 0.3);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.processing-step {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--primary-dark-blue);
    opacity: 0;
    animation: stepFadeIn 0.4s ease forwards;
}

.processing-step:nth-child(1) { animation-delay: 0.2s; }
.processing-step:nth-child(2) { animation-delay: 0.6s; }
.processing-step:nth-child(3) { animation-delay: 1.0s; }

.processing-step .step-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.processing-step .step-label {
    flex-grow: 1;
}

.processing-step .step-status {
    color: #28a745;
    font-size: 0.8rem;
    font-weight: 600;
}

.processing-confidence {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--primary-dark-blue);
    opacity: 0;
    animation: stepFadeIn 0.4s ease forwards;
    animation-delay: 1.4s;
    border-top: 1px solid rgba(171, 184, 195, 0.2);
    margin-top: 0.25rem;
    padding-top: 0.65rem;
}

.processing-confidence .confidence-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(0, 48, 91, 0.1);
    color: var(--primary-dark-blue);
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.gated-risk-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ===== MICRO-ANIMATIONS ===== */

/* 1. Scroll-reveal: elements fade up when entering viewport */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children within a row */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.3s; }

/* 2. Card hover lift */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 48, 91, 0.1);
}

/* Exclude form cards and results cards from hover lift */
.calculator-section .card:hover,
.results-card:hover,
.processing-state:hover {
    transform: none;
    box-shadow: none;
}

/* 3. Hero text fade-in */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section h1 {
    animation: heroFadeUp 0.7s ease forwards;
}

.hero-section .lead,
.hero-section p {
    animation: heroFadeUp 0.7s ease 0.15s forwards;
    opacity: 0;
}

.hero-section .btn,
.hero-section a.btn {
    animation: heroFadeUp 0.7s ease 0.3s forwards;
    opacity: 0;
}

/* 4. Button hover effects */
.btn-primary,
.btn[style*="primary-orange"],
a.btn[style*="primary-orange"] {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-primary:hover,
.btn[style*="primary-orange"]:hover,
a.btn[style*="primary-orange"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 78, 34, 0.35);
}

.btn-primary:active,
.btn[style*="primary-orange"]:active,
a.btn[style*="primary-orange"]:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline-primary {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 48, 91, 0.15);
}

/* 5. Tab switch fade */
.tab-pane {
    animation: tabFadeIn 0.3s ease;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 6. Counter animation helper */
.count-up {
    display: inline-block;
}

/* 7. Smooth icon hover in nav */
.nav-link {
    transition: color 0.2s ease;
}

/* 8. Accordion smooth open */
.accordion-collapse {
    transition: height 0.3s ease;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .card { transition: none; }
    .card:hover { transform: none; }
    .hero-section h1,
    .hero-section .lead,
    .hero-section p,
    .hero-section .btn,
    .hero-section a.btn {
        animation: none;
        opacity: 1;
    }
    .tab-pane { animation: none; }
    .btn-primary:hover,
    .btn[style*="primary-orange"]:hover {
        transform: none;
    }
}