/* =====================================================
   LidarAlign.com - Responsive Stylesheet
   Mobile and Tablet Optimizations
   ===================================================== */

/* Tablet Styles - iPad and similar devices */
@media screen and (max-width: 1024px) {
    /* Container adjustments */
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-md);
    }
    
    /* Hero adjustments */
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-visual {
        height: 400px;
    }
    
    /* Value grid - 2 columns */
    .value-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Calculator widget - stack on tablets */
    .calculator-widget {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    /* Applications grid - 2 columns */
    .app-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Network domains - stack vertically */
    .network-domains {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Footer - 2 columns */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
    
    /* Before/After slider adjustments */
    .slider-container {
        height: 300px;
    }
    
    /* Pattern generator controls */
    .generator-controls {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .control-group {
        width: 100%;
    }
    
    .btn-generate {
        width: 100%;
    }
}

/* Large Mobile Styles - Phones in landscape */
@media screen and (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: var(--bg-primary);
        flex-direction: column;
        padding: var(--spacing-2xl);
        gap: var(--spacing-lg);
        transition: left var(--transition-base);
        border-top: 1px solid var(--border-color);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero adjustments */
    .hero {
        padding: calc(80px + var(--spacing-2xl)) 0 var(--spacing-2xl);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .hero-cta .btn {
        width: 100%;
    }
    
    .hero-stats {
        justify-content: space-between;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Value cards - single column */
    .value-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tech accordion */
    .accordion-header {
        padding: var(--spacing-md);
    }
    
    .accordion-header h3 {
        font-size: 1.125rem;
    }
    
    .tech-detail {
        padding: 0 var(--spacing-md) var(--spacing-md);
    }
    
    /* Calculator results grid */
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tab buttons - scrollable */
    .tab-buttons {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.875rem;
    }
    
    /* CTA features - stack */
    .cta-features {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
        max-width: 300px;
        margin: var(--spacing-xl) auto;
    }
    
    /* Footer - single column */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .footer-links ul,
    .footer-legal ul,
    .footer-network ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-md);
    }
}

/* Small Mobile Styles - Standard phones */
@media screen and (max-width: 480px) {
    /* Base adjustments */
    body {
        font-size: 14px;
    }
    
    /* Container padding */
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Hero section */
    .hero {
        padding: calc(70px + var(--spacing-xl)) 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .hero-visual {
        height: 350px;
    }
    
    .alignment-visualization {
        padding: var(--spacing-md);
    }
    
    /* Hide complex 3D elements on small screens */
    .coordinate-system {
        display: none;
    }
    
    /* Simplify sensor display */
    .sensor-body {
        width: 40px;
        height: 40px;
    }
    
    .sensor-label {
        font-size: 0.625rem;
    }
    
    /* Stats display */
    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }
    
    .stat {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .stat:last-child {
        border-bottom: none;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.875rem;
    }
    
    /* Section spacing */
    section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .section-subtitle {
        font-size: 0.875rem;
        margin-bottom: var(--spacing-lg);
    }
    
    /* Value cards */
    .value-card {
        padding: var(--spacing-md);
    }
    
    .value-icon {
        width: 36px;
        height: 36px;
    }
    
    .value-card h3 {
        font-size: 1.125rem;
    }
    
    .value-card p {
        font-size: 0.875rem;
    }
    
    /* Accordion */
    .accordion-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .accordion-header h3 {
        font-size: 1rem;
    }
    
    .accordion-icon {
        font-size: 1.25rem;
    }
    
    .tech-detail h4 {
        font-size: 1rem;
    }
    
    .tech-detail li {
        font-size: 0.875rem;
        padding-left: var(--spacing-md);
    }
    
    /* Calculator */
    .calculator-widget {
        padding: var(--spacing-lg);
    }
    
    .input-group label {
        font-size: 0.875rem;
    }
    
    .input-value {
        font-size: 0.875rem;
    }
    
    .result-value {
        font-size: 1.25rem;
    }
    
    .result-label {
        font-size: 0.75rem;
    }
    
    .result-recommendation {
        font-size: 0.875rem;
        padding: var(--spacing-sm);
    }
    
    /* Before/After Demo */
    .before-after-demo {
        padding: var(--spacing-md);
    }
    
    .before-after-demo h3 {
        font-size: 1.125rem;
        margin-bottom: var(--spacing-md);
    }
    
    .slider-container {
        height: 250px;
    }
    
    /* Pattern generator */
    #pattern-canvas {
        height: 250px;
    }
    
    /* Applications */
    .app-card {
        padding: var(--spacing-md);
    }
    
    .app-header h3 {
        font-size: 1.125rem;
    }
    
    .app-badge {
        font-size: 0.625rem;
        padding: 2px var(--spacing-xs);
    }
    
    .app-card p {
        font-size: 0.875rem;
    }
    
    .app-features li {
        font-size: 0.875rem;
    }
    
    /* Resources */
    .resource-tabs {
        padding: var(--spacing-md);
    }
    
    .resource-list h4 {
        font-size: 1rem;
    }
    
    .resource-list p {
        font-size: 0.875rem;
    }
    
    .resource-meta {
        font-size: 0.75rem;
    }
    
    /* CTA Section */
    .cta-content {
        padding: var(--spacing-xl);
    }
    
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-content p {
        font-size: 0.875rem;
    }
    
    .cta-feature {
        font-size: 0.875rem;
    }
    
    /* Network box */
    .network-box {
        padding: var(--spacing-xl);
    }
    
    .network-box h2 {
        font-size: 1.5rem;
    }
    
    .domain-card {
        padding: var(--spacing-md);
    }
    
    .domain-icon {
        width: 36px;
        height: 36px;
    }
    
    .domain-card h3 {
        font-size: 1.125rem;
    }
    
    .domain-card p {
        font-size: 0.75rem;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-xl) 0;
    }
    
    .footer-brand h4,
    .footer-links h4,
    .footer-legal h4,
    .footer-network h4 {
        font-size: 1.125rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .footer-brand p {
        font-size: 0.75rem;
    }
    
    .footer-links a,
    .footer-legal a,
    .footer-network a {
        font-size: 0.875rem;
    }
    
    .footer-bottom p {
        font-size: 0.625rem;
        line-height: 1.4;
    }
    
    /* Disclaimer boxes */
    .calculator-disclaimer {
        padding: var(--spacing-sm);
    }
    
    .calculator-disclaimer p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
}

/* Extra Small Mobile - Very small devices */
@media screen and (max-width: 360px) {
    /* Further reductions for very small screens */
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 0.875rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.75rem;
    }
    
    /* Hide decorative elements */
    .alignment-indicator,
    .calibration-pattern {
        display: none;
    }
    
    /* Simplify calibration status */
    .calibration-status {
        font-size: 0.625rem;
        padding: var(--spacing-xs);
    }
    
    .status-metrics {
        display: none;
    }
}

/* Landscape Mobile Adjustments */
@media screen and (max-height: 600px) and (orientation: landscape) {
    /* Reduce vertical spacing */
    .hero {
        padding-top: calc(60px + var(--spacing-lg));
        padding-bottom: var(--spacing-lg);
    }
    
    .hero-visual {
        height: 300px;
    }
    
    section {
        padding: var(--spacing-xl) 0;
    }
    
    /* Hide hero stats in landscape to save space */
    .hero-stats {
        display: none;
    }
}

/* High Resolution Displays */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    /* Ensure crisp borders and text */
    .btn,
    .value-card,
    .app-card,
    .domain-card,
    .accordion-item {
        border-width: 0.5px;
    }
}

/* Print Styles */
@media print {
    /* Hide interactive elements */
    .nav-header,
    .mobile-menu-toggle,
    .hero-visual,
    .calculator-section,
    .pattern-section,
    .before-after-demo,
    .cta-section,
    .footer {
        display: none !important;
    }
    
    /* Adjust layout for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
        color: #000;
    }
    
    .section-title {
        font-size: 18pt;
    }
    
    .tech-detail ul,
    .resource-list {
        page-break-inside: avoid;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    /* Show URLs for links */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .alignment-visualization,
    .sensor,
    .point-cloud .point {
        animation: none !important;
    }
}

/* Dark Mode Support (System Preference) */
@media (prefers-color-scheme: light) {
    /* Override for users who prefer light mode */
    /* Keep dark theme as designed for this tech domain */
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets for touch devices */
    .btn,
    .tab-btn,
    .accordion-header {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Remove hover effects on touch devices */
    .value-card:hover,
    .app-card:hover,
    .domain-card:hover {
        transform: none;
    }
    
    /* Improve slider handle for touch */
    .slider-handle {
        width: 40px;
        cursor: grab;
    }
    
    .slider-handle:active {
        cursor: grabbing;
    }
}