/* ========================================
   Responsive Styles - ConnectHub
   Mobile First & Optimized
   ======================================== */

/* ===== Base Mobile Styles (Default) ===== */
/* All base styles are optimized for mobile first */

/* ===== Enhanced Mobile Styles (< 768px) ===== */
@media (max-width: 767px) {
    
    /* Container */
    .container {
        padding: 0 1rem;
    }
    
    /* Typography - Mobile Optimized */
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Header - Mobile Optimized */
    .header {
        height: 60px;
        padding: 0;
    }
    
    .navbar {
        height: 60px;
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.125rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .logo-company {
        display: none;
    }
    
    .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    /* Hero Section - Mobile */
    .hero {
        padding-top: 80px;
        padding-bottom: 2rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        margin-bottom: 1rem;
    }
    
    .hero-process {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .process-step {
        padding: 0.75rem 1rem;
        width: 100%;
        justify-content: center;
    }
    
    .process-icon {
        font-size: 1.5rem;
    }
    
    .process-text {
        font-size: 0.875rem;
    }
    
    .process-arrow {
        transform: rotate(90deg);
        font-size: 1.5rem;
    }
    
    /* CTA Buttons - Mobile */
    .hero-cta {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        justify-content: center;
    }
    
    /* Trust Indicators */
    .trust-indicators {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.5rem 0;
    }
    
    .trust-item {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
        background: white;
        border-radius: 0.75rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    /* Stats */
    .live-stats {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    .stats-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.875rem;
    }
    
    /* Sections */
    section {
        padding: 2rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    /* Problem Cards */
    .problem-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .problem-card {
        padding: 1.5rem;
    }
    
    .problem-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .problem-title {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
    
    .problem-description {
        font-size: 0.875rem;
    }
    
    /* Stats Box */
    .stats-box {
        padding: 1.5rem;
    }
    
    .stats-box-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .stats-list li {
        font-size: 0.875rem;
        padding: 0.625rem 0;
    }
    
    .stats-message {
        font-size: 1.125rem;
        margin: 1.5rem 0;
    }
    
    /* Quick Understand */
    .quick-understand {
        flex-direction: column;
        padding: 1.5rem;
        gap: 0.75rem;
    }
    
    .quick-icon {
        font-size: 2.5rem;
    }
    
    .quick-text {
        font-size: 1rem;
    }
    
    .quick-arrow {
        transform: rotate(90deg);
        font-size: 2rem;
    }
    
    /* Step Cards */
    .step-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .step-number-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }
    
    .step-title {
        font-size: 1rem;
        width: 100%;
    }
    
    .step-time {
        font-size: 0.875rem;
    }
    
    .step-toggle {
        align-self: flex-end;
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .step-summary p {
        font-size: 0.875rem;
    }
    
    .step-content {
        padding: 1rem;
    }
    
    .step-content h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .step-content li {
        font-size: 0.875rem;
    }
    
    .channel-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .channel-badge {
        font-size: 0.75rem;
        padding: 0.375rem;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .feature-item {
        padding: 0.875rem;
        flex-wrap: wrap;
    }
    
    .feature-text {
        font-size: 0.875rem;
    }
    
    .badge-world-first {
        font-size: 0.625rem;
        padding: 0.125rem 0.5rem;
        margin-top: 0.25rem;
    }
    
    /* Comparison Table - Horizontal Scroll */
    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .comparison-table {
        min-width: 600px;
        font-size: 0.75rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.375rem;
    }
    
    .check-icon,
    .cross-icon {
        font-size: 1.25rem;
    }
    
    /* Before/After */
    .ba-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .ba-card {
        padding: 1.5rem;
    }
    
    .ba-header h4 {
        font-size: 1.25rem;
    }
    
    .ba-flow p {
        font-size: 0.875rem;
        padding: 0.625rem;
    }
    
    .ba-metrics {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .metric {
        width: 100%;
        padding: 0.75rem;
        background: var(--bg-light);
        border-radius: 0.5rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    /* Performance Cards */
    .performance-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .performance-card {
        padding: 1.25rem;
    }
    
    .performance-value {
        font-size: 1.75rem;
    }
    
    /* Adoption Cards */
    .adoption-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .adoption-card {
        padding: 1.5rem;
    }
    
    .adoption-icon {
        font-size: 3rem;
    }
    
    .adoption-title {
        font-size: 1.25rem;
    }
    
    /* Voucher */
    .voucher-benefits {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .benefit-card {
        padding: 1.25rem;
    }
    
    .benefit-icon {
        font-size: 2.5rem;
    }
    
    .benefit-title {
        font-size: 1.125rem;
    }
    
    .voucher-box {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .voucher-icon {
        font-size: 3rem;
    }
    
    .voucher-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .voucher-description {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .voucher-list li {
        font-size: 0.875rem;
    }
    
    /* Forms */
    .contact-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .form-card,
    .info-card,
    .faq-card {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    .form-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .form-subtitle {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }
    
    .form-input,
    .form-textarea {
        padding: 0.875rem;
        font-size: 16px; /* Prevents iOS zoom */
        border-radius: 0.5rem;
    }
    
    .form-group {
        gap: 0.75rem;
    }
    
    .btn-submit {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 0.75rem;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .footer-col h4 {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-col li {
        margin-bottom: 0.5rem;
    }
    
    .footer-col a {
        font-size: 0.875rem;
    }
    
    .footer-bottom {
        font-size: 0.75rem;
        padding-top: 1.5rem;
    }
    
    /* Phone Mockup */
    .phone-mockup {
        width: 240px;
        height: 480px;
        border-radius: 30px;
        padding: 15px;
    }
    
    .phone-screen {
        border-radius: 20px;
    }
    
    .animation-icon {
        font-size: 3rem;
    }
    
    .animation-step p {
        font-size: 0.875rem;
    }
    
    /* Scroll to Top */
    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.25rem;
    }
    
    /* Buttons - Touch Friendly */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .btn-large {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    /* CTA Messages */
    .cta-message {
        font-size: 1.125rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    .solution-cta {
        margin-top: 2rem;
    }
}

/* ===== Extra Small Mobile (< 375px) ===== */
@media (max-width: 374px) {
    
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .btn-primary {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .comparison-table {
        min-width: 500px;
        font-size: 0.625rem;
    }
}

/* ===== Tablet (768px ~ 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    
    /* Typography */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    /* Grid Layouts */
    .problem-grid,
    .stats-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .adoption-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .voucher-benefits {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hero */
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-process {
        flex-direction: row;
        justify-content: center;
    }
    
    .process-arrow {
        transform: none;
    }
    
    /* Footer */
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Desktop (> 1024px) ===== */
@media (min-width: 1024px) {
    
    /* Container */
    .container {
        padding: 0 2rem;
    }
    
    /* Hero */
    .hero-content {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 4rem;
    }
    
    /* Grid Layouts */
    .problem-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .performance-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .ba-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .adoption-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .voucher-benefits {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .contact-container {
        grid-template-columns: 1.2fr 0.8fr;
    }
    
    .footer-content {
        grid-template-columns: 1.5fr 2fr;
    }
    
    .footer-links {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    
    /* Larger touch targets */
    .btn {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }
    
    .nav-link {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        padding: 0.5rem;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
    
    /* Remove hover effects */
    .problem-card:hover,
    .adoption-card:hover,
    .step-card:hover,
    .benefit-card:hover {
        transform: none;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    }
    
    /* Better tap highlights */
    * {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }
}

/* ===== Landscape Mobile ===== */
@media (max-height: 600px) and (orientation: landscape) {
    
    .hero {
        padding-top: 80px;
        padding-bottom: 1rem;
    }
    
    section {
        padding: 1.5rem 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    
    .header,
    .nav-actions,
    .mobile-menu-toggle,
    .scroll-top,
    .btn,
    .form-card,
    .contact-form {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    .container {
        max-width: 100%;
    }
}

/* ===== Accessibility - Reduced Motion ===== */
@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;
    }
    
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .badge-world-first {
        animation: none !important;
    }
}

/* ===== Mobile Navigation Menu (Overlay) ===== */
@media (max-width: 1023px) {
    
    .nav-menu {
        display: none;
    }
    
    .nav-menu.mobile-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        gap: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .nav-menu.mobile-open .nav-link {
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
        font-size: 1rem;
    }
    
    .nav-menu.mobile-open .nav-link:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* ===== iOS Safari Fixes ===== */
@supports (-webkit-touch-callout: none) {
    
    /* Fix for iOS vh units */
    .hero {
        min-height: -webkit-fill-available;
    }
    
    /* Prevent zoom on input focus */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ===== Android Chrome Fixes ===== */
@media screen and (max-width: 767px) {
    
    /* Better scrolling on Android */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix input padding on Android */
    .form-input {
        line-height: 1.5;
    }
}
