/**
 * Responsive CSS for Index Page
 * Media queries and mobile optimizations
 */

/* Large Desktop and Up */
@media (min-width: 1200px) {
    .card-title {
        font-size: clamp(1.8rem, 3vw, 2.8rem);
    }
    
    .cta-title {
        font-size: 2.5rem !important;
    }
}

/* Desktop and Tablet Landscape */
@media (min-width: 769px) {
    /* Desktop tooltip - force width */
    .privacy-tooltip-content {
        width: 320px;
    }
    
    /* Ensure privacy section has same layout as how-it-works */
    .how-it-works-section {
        position: relative !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
    
    /* Desktop - no animations, everything visible by default */
    .privacy-text,
    .animate-card-title,
    .security-badge,
    .security-shield,
    .how-it-works-section .security-badge,
    .privacy-features li {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
}

/* Standard Tablet and Below */
@media (max-width: 768px) {
    /* Card Titles */
    .card-title {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }
    
    .cta-title {
        font-size: 1.8rem !important;
    }
    
    /* CTA Button Mobile Adjustments */
    .cta-button {
        white-space: normal !important;
        line-height: 1.2 !important;
        padding: 15px 20px !important;
        text-align: center !important;
    }
    
    .cta-button .bi-bar-chart {
        display: block !important;
        margin: 0 0 5px 0 !important;
    }
    
    /* Provider Grid Mobile Layout */
    .providers-grid {
        gap: 1rem;
        max-width: 400px;
    }
    
    .provider-logo {
        padding: 0.75rem;
        min-height: 60px;
        flex: 0 0 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
    }
    
    .provider-logo img {
        max-height: 40px;
    }
    
    .providers-title {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    /* Compact Providers Mobile Layout */
    .providers-section-compact {
        padding: 0.75rem;
    }
    
    .providers-title-compact {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .providers-grid-compact {
        gap: 0.5rem;
    }
    
    .provider-logo-compact {
        height: 40px;
        width: 60px;
        padding: 0.3rem;
    }
    
    .provider-logo-compact img {
        max-height: 24px;
    }
    
    /* Toggle Switch Mobile Adjustments */
    .anonymization-toggle {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .toggle-switch {
        width: 48px;
        height: 24px;
        flex-shrink: 0;
    }
    
    .toggle-label {
        flex-shrink: 0;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .slider:before {
        height: 16px;
        width: 16px;
        left: 4px;
        bottom: 4px;
    }
    
    .toggle-switch input:checked + .slider:before {
        transform: translateX(20px);
    }
    
    .anonymization-toggle-container {
        padding: 10px 12px;
    }
    
    /* Privacy Tooltip Mobile Layout */
    .privacy-tooltip {
        flex-shrink: 0;
        margin-left: 4px;
    }
    
    .privacy-tooltip-content {
        white-space: normal;
        max-width: 280px;
        left: 50%;
        top: 100%;
        margin-top: 10px;
        transform: translateX(-50%);
    }
    
    .privacy-tooltip-content::after {
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-bottom-color: var(--card-background);
        border-top: none;
    }
    
    .privacy-tooltip:hover .privacy-tooltip-content {
        transform: translateX(-50%) translateY(5px);
    }
    
    /* Provider Selection Mobile Layout */
    .provider-selection .form-label {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem 0;
    }
    
    .provider-selection .form-label i.bi-building {
        margin-right: 0.5rem !important;
    }
    
    .provider-selection .form-label .privacy-tooltip {
        margin-left: 0.5rem;
    }
    
    .provider-selection .form-label .text-muted {
        margin-left: 0 !important;
        flex-basis: 100%;
        margin-top: 0.25rem;
    }
    
    /* Privacy Settings Section Mobile Spacing */
    .col-md-6:has(.form-label:contains("Privacy Settings")),
    .col-md-6:nth-child(2) {
        margin-top: 2rem;
    }
    
    .currency-select {
        margin-bottom: 1rem;
    }
    
    /* Animation Mobile Adjustments */
    .connecting-line {
        left: 20px;
        top: 20px;
        bottom: 20px;
    }
    
    .how-it-works-section .neomorphism-steps li {
        transform: translateX(-20px);
    }
    
    .privacy-text {
        transform: translateY(15px);
    }
    
    /* Guide Link Mobile Adjustments */
    .guides-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        gap: 0.2rem;
    }
    
    .guides-link i:first-child {
        font-size: 0.85rem;
    }
    
    .guides-link i:last-child {
        font-size: 0.7rem;
    }
    
    /* Layout Adjustments for Fixed Navigation */
    .card, .cta-section {
        position: relative;
        z-index: 1;
    }
    
    html, body {
        overflow-x: hidden;
        position: relative;
        transform: none !important;
    }
    
    main, .container, .row, .col-12, .col-md-8, .col-lg-6 {
        transform: none !important;
        position: relative;
    }
    
    /* Ensure parent elements don't interfere with floating nav */
    .how-it-works-section,
    .col-lg-4,
    .card,
    .container,
    .row,
    main,
    body {
        position: static !important;
        transform: none !important;
        contain: none !important;
        backdrop-filter: none !important;
        filter: none !important;
        transform-style: flat !important;
        isolation: auto !important;
    }
    
    html {
        transform: none !important;
        position: static !important;
    }
}

/* Small Mobile Phones */
@media (max-width: 576px) {
    .card-title {
        font-size: clamp(1.1rem, 6vw, 1.8rem);
        line-height: 1.2;
    }
    
    .card-title .title-dash {
        display: none;
    }
    
    .card-title .title-second-part {
        display: block;
        margin-top: 0.3rem;
    }
    
    .card-title .title-second-part:before {
        content: "- ";
        color: rgba(139, 92, 246, 0.7);
    }
    
    .cta-title {
        font-size: 1.6rem !important;
    }
    
    /* Further compress provider grid on very small screens */
    .providers-grid-compact {
        gap: 0.3rem;
    }
    
    .provider-logo-compact {
        height: 35px;
        width: 55px;
        padding: 0.2rem;
    }
    
    .provider-logo-compact img {
        max-height: 20px;
    }
    
    /* Smaller buttons on small screens */
    .cta-button {
        min-width: 180px !important;
        font-size: 1rem !important;
        padding: 12px 16px !important;
    }
    
    /* Compact form elements */
    .form-select, .currency-select {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.9rem;
    }
    
    .anonymization-toggle-container {
        padding: 8px 10px;
    }
    
    .toggle-label {
        font-size: 0.85rem;
    }
}

/* Extra Small Screens */
@media (max-width: 375px) {
    .cta-title {
        font-size: 1.4rem !important;
    }
    
    .cta-button {
        min-width: 160px !important;
        font-size: 0.9rem !important;
        padding: 10px 14px !important;
    }
    
    .providers-grid-compact {
        gap: 0.2rem;
    }
    
    .provider-logo-compact {
        height: 32px;
        width: 50px;
        padding: 0.15rem;
    }
    
    .provider-logo-compact img {
        max-height: 18px;
    }
}

/* High DPI/Retina Display Adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .provider-logo img,
    .provider-logo-compact img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Orientation Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .upload-zone {
        padding: 2rem;
    }
    
    .card-title {
        font-size: clamp(1rem, 4vw, 1.6rem);
    }
    
    .cta-title {
        font-size: 1.5rem !important;
    }
    
    /* Reduce vertical spacing in landscape */
    .neomorphism-steps li {
        margin-bottom: 1rem;
    }
    
    .providers-section-compact {
        padding: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .guide-modal,
    .privacy-tooltip-content,
    .custom-tooltip .tooltip-text {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .btn-primary,
    .cta-button {
        background: transparent !important;
        border: 2px solid #333 !important;
        color: #333 !important;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .connecting-line {
        opacity: 1 !important;
        transform: scaleY(1) !important;
    }
    
    .how-it-works-section .neomorphism-steps li,
    .privacy-text,
    .animate-card-title,
    .security-badge,
    .security-shield,
    .guides-link {
        opacity: 1 !important;
        transform: none !important;
    }
}