/* Custom styles for index.html */

/* Prevent flicker: Initially hide both, then show correct one via JS */
#profile-section, #subscriptions-section {
    visibility: hidden;
}

/* Flyout System Styles */
.flyout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.flyout-overlay.active {
    opacity: 1;
    visibility: visible;
}

.flyout-panel {
    position: fixed;
    top: 0;
    padding-top: 130px;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--tw-bg-slate-50);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px 0 0 12px;
    overflow: hidden;
}

.flyout-panel.active {
    transform: translateX(0);
}

/* Tracker Toggle Button Active State */
#tracker-toggle-btn {
    position: fixed !important;
    bottom: 2.5rem !important;
    right: 2.5rem !important;
    left: auto !important;
    z-index: 90 !important;
}

#tracker-toggle-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

#tracker-toggle-btn.active::after {
    opacity: 1;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Day Selector - Desktop: Ensure horizontal layout (all screen sizes) */
day-selector,
.day-selector-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 0.5rem !important;
    width: 100% !important;
    flex-wrap: nowrap !important; /* Prevent wrapping */
}

/* Day selector labels - Desktop: Fill grid cells */
day-selector label {
    min-width: 0 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Day selector buttons - Desktop: Maintain square aspect ratio */
day-selector label > div {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 !important;
    min-height: 2.75rem !important; /* 44px minimum for touch target */
}

/* Override Tailwind fixed sizes on desktop to allow responsive sizing */
day-selector .w-10,
day-selector .h-10,
day-selector .sm\:w-11,
day-selector .sm\:h-11 {
    width: 100% !important;
    height: 100% !important;
}

/* Mobile positioning improvements */
@media (max-width: 768px) {
    .flyout-panel {
        max-width: 100%;
        border-radius: 0;
        padding-top: 80px;
    }
    
    #tracker-toggle-btn {
        bottom: 1.5rem !important;
        right: 1.5rem !important;
        left: auto !important;
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* Hide tracker button on mobile (640px and below) - override all previous rules */
@media (max-width: 640px) {
    #tracker-toggle-btn,
    #tracker-flyout-container,
    button#tracker-toggle-btn,
    div#tracker-flyout-container,
    [id="tracker-flyout-container"],
    [id="tracker-toggle-btn"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* Dark mode overrides for flyout panel */
.dark .flyout-panel {
    background-color: var(--tw-bg-slate-900);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.4);
}

/* Ensure that the header background is respected for the flyout header */
.flyout-panel .card-header {
    background-color: var(--tw-bg-slate-50);
}

.dark .flyout-panel .card-header {
    background-color: var(--tw-bg-slate-800);
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    overflow-y: scroll;
}

body {
    font-family: 'Inter', sans-serif;
}

.blob {
    position: absolute;
    filter: blur(40px);
    z-index: -1;
    opacity: 0.5;
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

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

@keyframes ghostFade {
    0%, 100% {
        opacity: 1;
        filter: blur(0px);
    }
    50% {
        opacity: 0.2;
        filter: blur(4px);
    }
}

.animate-ghost {
    animation: ghostFade 6s ease-in-out infinite;
}

/* Gradient Text Animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-text-animated {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
}

/* Scroll-triggered animations */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-fade-in-delay-1 {
    transition-delay: 0.1s;
}

.scroll-fade-in-delay-2 {
    transition-delay: 0.2s;
}

.scroll-fade-in-delay-3 {
    transition-delay: 0.3s;
}

/* Feature Highlights Improvements */
.feature-highlight-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 0.5rem;
}

.feature-highlight-item:hover {
    transform: translateX(6px);
    background-color: rgba(16, 185, 129, 0.05);
}

.dark .feature-highlight-item:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

.feature-highlight-item:hover .feature-check-icon {
    transform: scale(1.15) rotate(5deg);
    color: #10b981;
}

.feature-check-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

/* Mobile Wizard Styles */
#mobile-wizard {
    display: none;
}

@media (max-width: 768px) {
    #mobile-wizard {
        display: flex;
    }

    /* Hide desktop main content on mobile */
    main.md\:block {
        display: none !important;
    }

    /* Wizard slide system - no scrolling, fit to viewport */
    .wizard-slide {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0;
        transform: translateX(100%);
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
        pointer-events: none;
        overflow: hidden !important; /* No scrolling - content must fit */
        display: flex;
        flex-direction: column;
    }
    
    /* Prevent scrolling on wizard main content area */
    #mobile-wizard main {
        overflow: hidden !important; /* No scrolling */
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    #mobile-wizard main::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .wizard-slide.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .wizard-slide.prev {
        transform: translateX(-100%);
    }

    /* Ticker animation - works for both mobile and desktop */
    .ticker-wrap {
        width: 100%;
        overflow: hidden;
    }

    .ticker {
        display: flex;
        white-space: nowrap;
        animation: ticker 30s linear infinite;
    }

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


    /* Hide scrollbar */
    .no-scrollbar::-webkit-scrollbar { 
        display: none; 
    }
    .no-scrollbar { 
        -ms-overflow-style: none; 
        scrollbar-width: none; 
    }

    /* Wizard period button styling */
    .wizard-period-btn.active {
        background-color: rgb(209 250 229) !important;
        border-color: rgb(16 185 129) !important;
        color: rgb(21 128 61) !important;
    }

    .wizard-period-btn.active.dark {
        background-color: rgba(16, 185, 129, 0.2) !important;
        border-color: rgb(16 185 129) !important;
        color: rgb(167 243 208) !important;
    }
}

/* Mobile Minimalistic Utilities */
@media (max-width: 640px) {
    .mobile-minimal {
        /* Utility class for minimalistic mobile design */
    }

    .mobile-condensed {
        padding: 1rem !important;
        margin: 0.5rem 0 !important;
    }

    /* Reduce animations on mobile */
    .scroll-fade-in,
    .fade-in-up {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    /* Simplify feature highlights on mobile */
    feature-highlights {
        display: none !important;
    }

    /* Hide trust text below button on initial splash page (mobile only) */
    .wizard-slide[data-slide="1"] > div > div:last-child > p.text-muted {
        display: none !important;
    }

    /* Hide ticker on splash screen (slide 1) - show on other wizard slides */
    /* Hide ticker by default (when slide 1 is active) */
    /* Show ticker on all slides now that we use global header */
    #mobile-wizard .ticker-wrap {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
        width: 100% !important;
        overflow: hidden !important;
        background-color: rgb(248 250 252) !important; /* slate-50 */
        border-bottom: 1px solid rgb(241 245 249) !important; /* slate-100 */
    }
    
    .dark #mobile-wizard .ticker-wrap {
        background-color: rgba(30, 41, 59, 0.5) !important; /* slate-800/50 */
        border-bottom-color: rgb(51 65 85) !important; /* slate-700 */
    }
    
    /* Ensure ticker is properly positioned in mobile wizard - below header */
    /* Header is 80px (5rem), so ticker needs margin-top to position below it */
    #mobile-wizard .ticker-wrap {
        margin-top: 5rem !important; /* Position below fixed header */
        margin-bottom: 0 !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Ensure consistent spacing regardless of slide (for slides 2+) */
    #mobile-wizard .ticker-wrap.py-2 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* Hide desktop ticker section on mobile (keep wizard ticker visible) */
    /* Hide ticker elements in tracker flyout panel on mobile */
    #live-claim-feed,
    #ticker-pause-btn,
    #ticker-refresh-btn,
    #ticker-content {
        display: none !important;
    }
    
    /* Hide the ticker section container - the div.mt-4 that contains the ticker */
    /* This targets the div that comes after the KPI grid in the tracker flyout */
    #tracker-flyout-panel .card .p-4 > .mt-4:first-of-type {
        display: none !important;
    }

    /* Ensure ticker is positioned correctly below header (header is 80px/5rem) */
    #mobile-wizard .ticker-wrap {
        margin-top: 5rem !important; /* Position below header (h-20 = 5rem) */
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }

    /* Ensure ticker content is visible and not clipped */
    #mobile-wizard .ticker {
        display: flex !important;
        align-items: center !important;
        animation: ticker 30s linear infinite !important;
    }
    
    /* Ensure ticker wrap is visible and properly styled in wizard */
    #mobile-wizard .ticker-wrap {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    /* Override general input[type="text"] padding for wizard inputs with icons */
    /* Ensure proper left padding so text appears to the right of icons, not underneath */
    /* Icon is at left-4 (1rem), icon is w-5 (1.25rem), so need at least 1rem + 1.25rem + gap = ~4rem */
    #mobile-wizard input[type="text"]#wizard-calc-from,
    #mobile-wizard input[type="text"]#wizard-calc-to,
    #mobile-wizard input[type="text"]#wizard-calc-price,
    #mobile-wizard #wizard-calc-from[type="text"],
    #mobile-wizard #wizard-calc-to[type="text"],
    #mobile-wizard #wizard-calc-price[type="text"] {
        padding-top: 0.875rem !important;
        padding-right: 1rem !important;
        padding-bottom: 0.875rem !important;
        padding-left: 4rem !important;
    }
}

/* Better Mobile Typography Scaling */
@media (max-width: 640px) {
    /* Base typography improvements */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    /* Heading improvements */
    h1 {
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
        letter-spacing: -0.02em;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.875rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem;
    }
    
    h3 {
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
    }
    
    /* Text size utilities */
    .text-4xl {
        font-size: 1.875rem;
        line-height: 1.2;
    }
    
    .text-5xl {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    .text-6xl {
        font-size: 3rem;
        line-height: 1.1;
    }
    
    .text-7xl {
        font-size: 3.5rem;
        line-height: 1.1;
    }
    
    /* Paragraph improvements */
    p {
        line-height: 1.7;
        margin-bottom: 1rem;
    }
    
    /* Better spacing for text content */
    .text-base,
    .text-sm,
    .text-xs {
        line-height: 1.6;
    }
    
    /* Hero section text improvements */
    .hero-content p,
    main p {
        line-height: 1.7;
    }
    
    /* Badge text improvements */
    .badge-base {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    /* Form label improvements */
    .form-label {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }
    
    /* Better spacing for feature highlights */
    feature-highlights {
        margin-top: 1.5rem;
    }
    
    /* Stats section typography */
    .stat-card .text-3xl {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .stat-card .text-xs {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    /* Calculator results typography */
    #calc-results .text-5xl {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    /* Citation text improvements */
    .citation-item {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    /* Prose content improvements */
    .prose {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .prose p {
        margin-bottom: 1.25rem;
    }
    
    .prose strong {
        font-weight: 600;
    }
}

/* Ticker Animation */
@keyframes feedScroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.animate-feed-scroll {
    display: inline-block;
    white-space: nowrap;
    animation: feedScroll var(--scroll-duration, 20s) linear infinite;
    will-change: transform;
}

.animate-feed-scroll.paused {
    animation-play-state: paused;
}

/* Ticker refresh button animation */
#ticker-refresh-btn {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Visual Consistency Improvements */

/* Consistent Spacing System */
:root {
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

/* Consistent Button Styles */
button, .btn, app-button button {
    min-height: 44px;
    min-width: 44px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:not(:disabled):hover, .btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

button:not(:disabled):active, .btn:not(:disabled):active {
    transform: translateY(0);
}

/* Improved Card Shadows and Borders */
.card {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .card {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
}

.dark .card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

/* Improved Dark Mode Contrast */
.dark .text-muted {
    color: #94a3b8;
}

.dark .text-slate-400 {
    color: #94a3b8;
}

.dark .text-slate-500 {
    color: #64748b;
}

/* Better Touch Targets for Mobile */
@media (max-width: 768px) {
    .input-field, button, .btn, app-button button {
        min-height: 44px;
    }
    
    .toggle-option {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .custom-dropdown-trigger {
        min-height: 44px;
    }
}

/* Consistent Emerald/Green Accent Colors */
.text-emerald-600 {
    color: #059669;
}

.dark .text-emerald-400 {
    color: #34d399;
}

.bg-emerald-500 {
    background-color: #10b981;
}

.dark .bg-emerald-500 {
    background-color: #10b981;
}

/* Hero Section Background Pattern */
.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    background-image: 
        radial-gradient(circle at 25% 25%, rgb(16, 185, 129) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgb(20, 184, 166) 0%, transparent 50%);
    background-size: 600px 600px;
    background-position: 0% 0%, 100% 100%;
    pointer-events: none;
    z-index: 0;
}

.dark .hero-pattern {
    opacity: 0.05;
    background-image: 
        radial-gradient(circle at 25% 25%, rgb(16, 185, 129) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgb(20, 184, 166) 0%, transparent 50%);
}

/* Badge Animation */
.badge-base {
    transition: all 0.3s ease;
}

.badge-base:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Currency input padding */
.input-field.pl-8 {
    padding-left: 2rem;
}

/* Calculator Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-title {
    height: 3rem;
}

.skeleton-kpi {
    height: 80px;
}

/* Calculator Results Animation */
#calc-results {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

#calc-results:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered animation for result numbers */
.calc-result-number {
    animation: numberPopIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes numberPopIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Enhanced form field focus states */
#calculator-form .input-field:focus,
#subscription-form .input-field:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    outline: none;
    transition: all 0.2s ease;
}

.dark #calculator-form .input-field:focus,
.dark #subscription-form .input-field:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

#calculator-form .input-field,
#subscription-form .input-field {
    transition: all 0.2s ease;
}

#calculator-form .input-field:hover:not(:focus),
#subscription-form .input-field:hover:not(:focus) {
    border-color: #cbd5e1;
}

.dark #calculator-form .input-field:hover:not(:focus),
.dark #subscription-form .input-field:hover:not(:focus) {
    border-color: #475569;
}

/* Subscription Form Validation States */
#subscription-form .input-field.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.dark #subscription-form .input-field.error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

#subscription-form .input-field.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.dark #subscription-form .input-field.valid {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

/* Password Strength Indicator */
#sub-password-strength {
    margin-top: 0.5rem;
}

#sub-password-strength-bar {
    transition: all 0.3s ease;
}

#sub-password-strength-bar.weak {
    background-color: #ef4444;
    width: 25% !important;
}

#sub-password-strength-bar.fair {
    background-color: #f59e0b;
    width: 50% !important;
}

#sub-password-strength-bar.good {
    background-color: #3b82f6;
    width: 75% !important;
}

#sub-password-strength-bar.strong {
    background-color: #10b981;
    width: 100% !important;
}

.sub-password-req {
    transition: color 0.2s ease;
}

.sub-password-req .req-icon {
    transition: all 0.2s ease;
}

.sub-password-req.met {
    color: #10b981;
}

.dark .sub-password-req.met {
    color: #34d399;
}

.sub-password-req.met .req-icon {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

.dark .sub-password-req.met .req-icon {
    background-color: #34d399;
    border-color: #34d399;
}

.sub-password-req.met .req-icon::before {
    content: '✓';
    font-size: 0.625rem;
}

/* Wizard Password Strength Indicator */
#wizard-password-strength {
    margin-top: 0.5rem;
}

#wizard-password-strength-bar {
    transition: all 0.3s ease;
}

#wizard-password-strength-bar.weak {
    background-color: #ef4444;
    width: 25% !important;
}

#wizard-password-strength-bar.fair {
    background-color: #f59e0b;
    width: 50% !important;
}

#wizard-password-strength-bar.good {
    background-color: #3b82f6;
    width: 75% !important;
}

#wizard-password-strength-bar.strong {
    background-color: #10b981;
    width: 100% !important;
}

.wizard-password-req {
    transition: color 0.2s ease;
}

.wizard-password-req .req-icon {
    transition: all 0.2s ease;
}

.wizard-password-req.met {
    color: #10b981;
}

.dark .wizard-password-req.met {
    color: #34d399;
}

.wizard-password-req.met .req-icon {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

.dark .wizard-password-req.met .req-icon {
    background-color: #34d399;
    border-color: #34d399;
}

.wizard-password-req.met .req-icon::before {
    content: '✓';
    font-size: 0.625rem;
}

/* Toast Container Mobile Positioning */
@media (max-width: 640px) {
    #toast-container {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 8rem !important;
        transform: none !important;
        z-index: 10000 !important;
        max-width: calc(100vw - 2rem) !important;
        position: fixed !important;
    }
    
    .toast-notification {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Status Message Styles */
#sub-status.success {
    color: #10b981;
}

.dark #sub-status.success {
    color: #34d399;
}

#sub-status.error {
    color: #ef4444;
}

.dark #sub-status.error {
    color: #f87171;
}

#sub-status.info {
    color: #3b82f6;
}

.dark #sub-status.info {
    color: #60a5fa;
}

/* Calculator Error States */
.input-field.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-field.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Copy Results Toast */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
}

.copy-toast svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #10b981;
}

/* Hero Section Enhancements */
.hero-content {
    position: relative;
    z-index: 1;
}

/* Improved mobile typography */
@media (max-width: 640px) {
    .hero-title {
        letter-spacing: -0.02em;
    }
}

/* Staggered animation delays for feature items */
.feature-highlight-item:nth-child(1) {
    animation-delay: 0s;
}

.feature-highlight-item:nth-child(2) {
    animation-delay: 0.1s;
}

.feature-highlight-item:nth-child(3) {
    animation-delay: 0.2s;
}

/* Smooth badge pulse animation */
@keyframes badgePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.badge-base span[class*="animate-pulse"] {
    animation: badgePulse 2s ease-in-out infinite;
}

/* Tooltip Styles - Removed (now handled inline in index.html) */

/* Stats Section Enhancements */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: currentColor;
}

.dark .stat-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.stat-card:hover::before {
    opacity: 0.3;
}

.stat-card.group:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

.stat-card .icon-box {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-bottom: 0 !important;
}

.stat-card .text-3xl {
    transition: all 0.3s ease;
}

.stat-card:hover .text-3xl {
    transform: scale(1.05);
}

/* Animated Counter Styles */
.counter-value {
    display: inline-block;
}

/* Citation Interactive Styles */
.citation-item {
    position: relative;
    cursor: help;
    transition: color 0.2s ease;
}

.citation-item:hover {
    color: #10b981;
}

.dark .citation-item:hover {
    color: #34d399;
}

.citation-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .citation-tooltip {
    background: #0f172a;
    border: 1px solid #334155;
}

.citation-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}

.dark .citation-tooltip::after {
    border-top-color: #0f172a;
}

.citation-item:hover .citation-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Improved Visual Hierarchy for Stats Section */
.stats-section {
    position: relative;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Scroll animation for stat cards */
.stat-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stat-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pricing Section Enhancements */
#pricing-container {
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* Mobile overflow fixes for cards */
@media (max-width: 640px) {
    /* Critical: Ensure minimum font size to prevent iOS zoom on inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="time"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="decimal"],
    input.input-field,
    textarea,
    select,
    .custom-dropdown-trigger {
        font-size: 16px !important;
        min-height: 44px;
    }
    
    /* Ensure input fields have proper padding for touch */
    .input-field {
        padding: 0.75rem 1rem !important;
        min-height: 44px;
    }
    
    /* Time inputs need special handling */
    input[type="time"] {
        font-size: 16px !important;
        min-height: 44px;
        padding: 0.75rem 1rem !important;
    }
    
    /* Stat cards grid - ensure no overflow */
    .grid.grid-cols-2 {
        gap: 0.25rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .stat-card {
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
        word-wrap: break-word;
    }
    
    /* Stat cards section - prevent overflow */
    section.py-16:not(#pricing) {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    /* Large stat card (col-span-2) - reduce padding on mobile */
    .stat-card.col-span-2 {
        padding: 1rem !important;
    }
    
    .stat-card.col-span-2 .flex.items-center.justify-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stat-card.col-span-2 .h-16.w-16 {
        align-self: flex-end;
    }
    
    /* Pricing container - ensure proper containment */
    #pricing-container {
        max-width: 100vw;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure pricing cards don't exceed viewport */
    pricing-card {
        max-width: calc(100vw - 3rem);
        flex-shrink: 0;
    }
    
    /* Prevent horizontal overflow on main content */
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
        position: relative;
    }
    
    main {
        overflow-x: hidden;
        max-width: 100%;
        width: 100%;
    }
    
    /* Ensure sections don't overflow */
    section {
        max-width: 100%;
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Prevent common elements from causing horizontal scroll */
    div,
    form,
    .card,
    .input-field,
    .custom-dropdown,
    .toggle-container {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Exception for elements that need to overflow (like pricing cards) */
    #pricing-container {
        max-width: 100vw;
    }
    
    #pricing-container pricing-card {
        max-width: calc(100vw - 3rem);
    }
    
    /* Calculator results - ensure no overflow */
    #calc-results {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Subscription form - prevent overflow */
    #subscription-form {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Grid containers - prevent overflow */
    .grid {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Container max-width constraints */
    .max-w-7xl,
    .max-w-5xl {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Enhanced touch targets for all interactive elements */
    button:not(nav button):not(#tracker-toggle-btn),
    .btn,
    app-button button,
    .toggle-option,
    .custom-dropdown-trigger,
    .custom-dropdown-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Toggle container buttons */
    .toggle-container label {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Tooltip icons - make them larger touch targets */
    .tooltip-container {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .tooltip-container svg {
        width: 20px;
        height: 20px;
    }
    
    /* Mobile tooltip support - show on tap/active state */
    .tooltip-container:active .tooltip,
    .tooltip-container.tooltip-active .tooltip {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Keep tooltip visible after tap on mobile */
    .tooltip-container.tooltip-mobile-active .tooltip {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Calculator and subscription form spacing improvements */
    #calculator-form .space-y-3 > * + *,
    #subscription-form .space-y-6 > * + *,
    #subscription-form .space-y-8 > * + * {
        margin-top: 1.25rem;
    }
    
    /* Form grid improvements for mobile - ensure single column */
    #calculator-form .grid,
    #subscription-form .grid {
        gap: 1rem;
        grid-template-columns: 1fr !important;
    }
    
    /* Calculator form specific mobile adjustments */
    #calculator-form {
        padding: 0;
    }
    
    #calculator-form .grid.grid-cols-1.sm\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    /* Calculator min-height adjustment for mobile */
    #calc-content-wrapper {
        min-height: auto !important;
    }
    
    /* Subscription form layout - ensure proper stacking */
    #subscription-form .grid.lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    /* Subscription form sections - better mobile spacing */
    #profile-section,
    #subscriptions-section {
        margin-bottom: 1.5rem;
    }
    
    /* Time input fields - better mobile layout */
    input[type="time"] {
        flex: 1;
        min-width: 0;
    }
    
    /* Time input container */
    .flex.items-center.gap-2:has(input[type="time"]) {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    /* Toggle container - ensure proper wrapping on mobile */
    .toggle-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Days selector - better mobile layout */
    #calc-days-selector {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    /* Ticket type selector - better mobile layout */
    #calc-duration-selector {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    #sub-ticket-type-selector {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    /* Hero section padding adjustment */
    main {
        padding-top: 6rem !important;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 2rem;
    }
    
    /* Section padding improvements */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    section.py-16 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    section.sm\:py-20 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }
    
    /* Calculator card padding */
    .card {
        padding: 1.25rem !important;
    }
    
    /* Subscription form card padding */
    #subscription-form {
        padding: 1.25rem;
    }
    
    /* Better spacing between form sections */
    #subscription-form > .grid > * {
        margin-bottom: 1.5rem;
    }
    
    /* Grid gap improvements */
    .grid.gap-12 {
        gap: 2rem;
    }
    
    .grid.gap-8 {
        gap: 1.5rem;
    }
    
    /* Spacing utilities for mobile */
    .mb-6 {
        margin-bottom: 1.25rem;
    }
    
    .mb-8 {
        margin-bottom: 1.5rem;
    }
    
    .mb-12 {
        margin-bottom: 2rem;
    }
    
    /* Hero section content spacing */
    main .grid.lg\:grid-cols-2 {
        gap: 2rem;
    }
    
    /* Day selector - Grid layout for consistent 7-day display */
    day-selector,
    .day-selector-grid {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    /* Day selector touch targets - ensure buttons are square and touchable */
    day-selector label {
        min-height: 44px;
        min-width: 0; /* Allow grid to control width */
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Day selector buttons - maintain square aspect ratio */
    day-selector .w-10,
    day-selector .h-10 {
        width: 100% !important;
        height: 100% !important;
        min-height: 44px;
        aspect-ratio: 1;
    }
}

pricing-card {
    overflow: visible !important;
}

pricing-card.scroll-fade-in {
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

pricing-card.scroll-fade-in.visible {
    transform: translateY(0) scale(1);
}

/* Enhanced hover effects for pricing cards */
pricing-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark pricing-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Special hover effect for highlighted card */
pricing-card[data-highlighted="true"]:hover,
#pricing-commuter-card:hover {
    transform: translateY(-12px) scale(1.03) !important;
    box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.25);
}

.dark pricing-card[data-highlighted="true"]:hover,
.dark #pricing-commuter-card:hover {
    box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.4);
}

/* Best Value Badge */
.pricing-badge-best-value {
    position: absolute;
    top: -10px;
    left: 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3), 0 2px 4px -1px rgba(16, 185, 129, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
    animation: badgePulse 2s ease-in-out infinite;
    white-space: nowrap;
}

.dark .pricing-badge-best-value {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.5), 0 2px 4px -1px rgba(16, 185, 129, 0.3);
}

/* Popular badge enhancement */
pricing-card .absolute.top-0 {
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

/* Pricing card feature list hover */
pricing-card:hover ul li {
    transform: translateX(4px);
    transition: transform 0.2s ease;
}

pricing-card ul li {
    transition: transform 0.2s ease;
}

/* Pricing card button hover enhancement */
pricing-card:hover app-button {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

pricing-card app-button {
    transition: transform 0.2s ease;
}

/* Pricing section header uses scroll-fade-in class, no additional styles needed */

/* Reset Calculator Button - Remove hover shadow and transform */
#calc-reset-btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

#calc-reset-btn {
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#calc-reset-btn:hover {
    background-color: rgba(148, 163, 184, 0.1);
}

.dark #calc-reset-btn:hover {
    background-color: rgba(148, 163, 184, 0.15);
}

