/* K-VISION EXPORT - Professional Responsive System */
/* Mobile First Design + PC Extension Strategy */

/* 
=================================================
1. BREAKPOINT SYSTEM (Industry Standard)
=================================================
Mobile:  ≤ 767px   (Smartphone)
Tablet:  768-1023px (Tablet)
Desktop: ≥ 1024px  (PC/Laptop)
=================================================
*/

/* 
=================================================
2. MOBILE FIRST BASE STYLES (Default)
=================================================
All styles below are optimized for mobile by default
*/

/* Container - Mobile First */
.container {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--space-md);
    margin: 0 auto;
}

/* Grid System - Mobile First */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

/* Fixed Bottom CTA (Mobile Priority) */
.fixed-bottom-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: var(--space-md);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
    border-top: 1px solid var(--border-light);
}

.fixed-bottom-cta .btn {
    width: 100%;
    justify-content: center;
}

/* Mobile Menu */
.mobile-menu {
    display: block;
}

.desktop-menu {
    display: none;
}

/* Stack Layout (Mobile Default) */
.stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Card - Mobile Optimized */
.card-mobile {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}

/* Touch Target - Minimum 44x44px for Accessibility */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Thumb Zone - Bottom Third of Screen */
.thumb-zone {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 33vh;
    pointer-events: none;
}

.thumb-zone > * {
    pointer-events: auto;
}

/* Single Purpose Screen (Mobile UX Rule) */
.mobile-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.mobile-screen-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.mobile-screen-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.mobile-screen-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-light);
}

/* 
=================================================
3. TABLET STYLES (768px - 1023px)
=================================================
Hybrid: Some mobile, some desktop features
*/

@media (min-width: 768px) and (max-width: 1023px) {
    /* Container - Tablet */
    .container {
        max-width: 720px;
        padding: 0 var(--space-lg);
    }
    
    /* Grid - 2 Columns */
    .grid-tablet-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Adaptive Navigation */
    .mobile-menu {
        display: none;
    }
    
    .desktop-menu {
        display: flex;
    }
    
    /* Card Layout */
    .card-tablet {
        display: flex;
        gap: var(--space-lg);
    }
    
    .card-tablet-image {
        flex: 0 0 200px;
    }
    
    .card-tablet-content {
        flex: 1;
    }
    
    /* Fixed Bottom CTA - Wider */
    .fixed-bottom-cta {
        padding: var(--space-lg) var(--space-xl);
    }
    
    .fixed-bottom-cta .btn {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* 
=================================================
4. DESKTOP STYLES (≥ 1024px)
=================================================
PC Extension: Comparison, Management, Multi-column
*/

@media (min-width: 1024px) {
    /* Container - Desktop */
    .container {
        max-width: 1200px;
        padding: 0 var(--space-xl);
    }
    
    /* Grid - 3 Columns */
    .grid-desktop-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-desktop-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-desktop-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Sidebar Layout (PC Specific) */
    .layout-sidebar {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: var(--space-xl);
        min-height: calc(100vh - 80px);
    }
    
    .sidebar {
        background: var(--bg-secondary);
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
        height: fit-content;
        position: sticky;
        top: 80px;
    }
    
    .main-content {
        padding: var(--space-lg);
    }
    
    /* Two Column Comparison (PC Enhancement) */
    .comparison-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }
    
    /* Three Column Dashboard (PC Admin) */
    .dashboard-layout {
        display: grid;
        grid-template-columns: 250px 1fr 300px;
        gap: var(--space-xl);
    }
    
    /* Fixed Bottom CTA - Hide on Desktop */
    .fixed-bottom-cta {
        position: static;
        box-shadow: none;
        border-top: none;
    }
    
    /* Desktop Menu */
    .mobile-menu {
        display: none;
    }
    
    .desktop-menu {
        display: flex;
    }
    
    /* Hover States (Desktop Only) */
    .hover-info {
        display: none;
        position: absolute;
        background: var(--bg-secondary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        padding: var(--space-md);
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }
    
    .hover-trigger:hover .hover-info {
        display: block;
    }
    
    /* Multi-column Card */
    .card-desktop {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: var(--space-xl);
    }
    
    /* Map + List Layout (Desktop Specific) */
    .map-list-layout {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 0;
        height: calc(100vh - 80px);
    }
    
    .map-container {
        height: 100%;
        position: sticky;
        top: 80px;
    }
    
    .list-container {
        height: 100%;
        overflow-y: auto;
        padding: var(--space-lg);
        background: var(--bg-secondary);
    }
}

/* 
=================================================
5. COMPONENT-SPECIFIC RESPONSIVE RULES
=================================================
*/

/* Navigation - Responsive */
.nav-menu {
    display: none; /* Hidden on mobile */
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }
}

/* Hero - Responsive Typography */
.hero h1 {
    font-size: var(--font-3xl);
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: var(--font-4xl);
    }
}

@media (min-width: 1024px) {
    .hero h1 {
        font-size: 48px;
    }
}

/* Features Grid - Responsive */
.features-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Vision Test - Responsive */
.vision-chart-container {
    min-height: 300px;
}

@media (min-width: 768px) {
    .vision-chart-container {
        min-height: 400px;
    }
}

@media (min-width: 1024px) {
    .vision-chart-container {
        min-height: 500px;
    }
}

/* 
=================================================
6. UTILITY CLASSES FOR RESPONSIVE CONTROL
=================================================
*/

/* Show/Hide by Device */
.mobile-only {
    display: block;
}

.tablet-only,
.desktop-only {
    display: none;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-only {
        display: none;
    }
    
    .tablet-only {
        display: block;
    }
}

@media (min-width: 1024px) {
    .mobile-only,
    .tablet-only {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
}

/* Responsive Spacing */
.spacing-mobile {
    padding: var(--space-md);
}

@media (min-width: 768px) {
    .spacing-tablet {
        padding: var(--space-lg);
    }
}

@media (min-width: 1024px) {
    .spacing-desktop {
        padding: var(--space-xl);
    }
}

/* Responsive Text Alignment */
.text-mobile-center {
    text-align: center;
}

@media (min-width: 1024px) {
    .text-desktop-left {
        text-align: left;
    }
}

/* 
=================================================
7. ACCESSIBILITY ENHANCEMENTS (All Devices)
=================================================
*/

/* Focus Visible - Keyboard Navigation */
*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-light: #666666;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* 
=================================================
8. PRINT STYLES (Results & Reports)
=================================================
*/

@media print {
    /* Hide navigation and buttons */
    header,
    footer,
    .btn,
    .nav-menu,
    .fixed-bottom-cta {
        display: none !important;
    }
    
    /* Show all content */
    .desktop-only,
    .tablet-only,
    .mobile-only {
        display: block !important;
    }
    
    /* Optimize for print */
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}
