/* 
    TheLab - Mobile Optimizations
    Ensuring perfect mobile experience
*/

/* Mobile breakpoint - 768px and below */
@media (max-width: 768px) {
    /* Spacing adjustments */
    :root {
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 3rem;
        --space-3xl: 4rem;
        --space-4xl: 6rem;
    }
    
    /* Container padding */
    .container {
        padding: 0 1rem;
    }
    
    /* Navigation mobile */
    nav {
        padding: 0.75rem 0;
    }
    
    .nav-container {
        padding: 0.5rem 1rem;
    }
    
    .logo {
        font-size: 1.125rem;
    }
    
    .nav-links {
        gap: 0.75rem;
    }
    
    .nav-links a:not(.nav-cta) {
        display: none;
    }
    
    .nav-cta {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    /* Hero mobile */
    #hero-section {
        min-height: 100vh;
        padding-top: 60px;
    }
    
    .hero-content {
        padding: var(--space-2xl) 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }
    
    /* Hero metrics mobile */
    .hero-metrics {
        flex-direction: row;
        justify-content: space-around;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .metric {
        text-align: center;
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
    
    .metric-label {
        font-size: 0.625rem;
    }
    
    .metric-divider {
        display: none;
    }
    
    /* Buttons mobile */
    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .primary-button,
    .secondary-button {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Team section mobile */
    .team-section {
        padding: var(--space-3xl) 0;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .member-card {
        padding: 1.25rem;
    }
    
    .member-avatar {
        width: 36px;
        height: 36px;
    }
    
    .member-content h3 {
        font-size: 1rem;
    }
    
    .member-title {
        font-size: 0.75rem;
    }
    
    .member-bio {
        font-size: 0.8125rem;
        line-height: 1.6;
    }
    
    .select-advisor {
        padding: 0.625rem 0;
        font-size: 0.6875rem;
    }
    
    /* Chat interface mobile */
    #app {
        margin: 1rem;
        padding: 1.5rem 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .chat-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .advisor-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    #advisor-select {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .conversation {
        min-height: 250px;
        max-height: 350px;
        margin-bottom: 1rem;
    }
    
    .message-content {
        max-width: 90%;
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    .input-container {
        gap: 0.5rem;
    }
    
    #user-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        min-height: 44px;
    }
    
    #send-button {
        min-width: 44px;
        height: 44px;
    }
    
    /* Core values mobile */
    .core-values-section {
        padding: var(--space-3xl) 0;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
        gap: 0;
        background: none;
        padding: 0;
    }
    
    .value-card {
        padding: 1.25rem;
        margin-bottom: 0.5px;
        background: var(--white);
        border: 0.5px solid rgba(0, 0, 0, 0.06);
    }
    
    .value-card h3 {
        font-size: 1.125rem;
    }
    
    .value-description {
        font-size: 0.875rem;
    }
    
    /* Method section mobile */
    .method-section {
        padding: var(--space-3xl) 0;
    }
    
    .timeline-line {
        display: none;
    }
    
    .method-step {
        flex-direction: column;
        margin-bottom: 2rem;
    }
    
    .step-marker {
        width: auto;
        margin-bottom: 1rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
    
    .step-content h3 {
        font-size: 1.25rem;
    }
    
    .step-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Experience section mobile */
    .experience-section {
        padding: var(--space-3xl) 0;
    }
    
    .journey-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }
    
    .journey-tab {
        padding: 1rem;
        min-width: 100px;
        flex-shrink: 0;
    }
    
    .phase-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Services mobile */
    .services-section {
        padding: var(--space-3xl) 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .service-card {
        padding: 1.25rem;
    }
    
    /* Footer mobile */
    footer {
        padding: var(--space-2xl) 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* Small mobile - 480px and below */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
    }
    
    .hero-metrics {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    #app {
        margin: 0.5rem;
        padding: 1rem;
        max-width: calc(100% - 1rem);
    }
    
    .conversation {
        min-height: 200px;
        max-height: 300px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    /* Ensure all interactive elements are at least 44x44px */
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .member-card:hover,
    .value-card:hover,
    .service-card:hover {
        transform: none;
        box-shadow: none !important;
    }
    
    /* Larger tap targets */
    .nav-links a {
        padding: 0.75rem;
    }
    
    .select-advisor {
        min-height: 44px;
        padding: 0.75rem 0;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #hero-section {
        min-height: auto;
        padding: var(--space-xl) 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .conversation {
        max-height: 200px;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Prevent text selection on iOS */
    .member-card,
    .value-card,
    button {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
    }
    
    /* Fix iOS input zoom */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
    
    /* Smooth scrolling */
    .conversation,
    .journey-nav {
        -webkit-overflow-scrolling: touch;
    }
}

/* Accessibility for mobile */
@media (max-width: 768px) {
    /* Larger focus outlines on mobile */
    :focus-visible {
        outline: 3px solid var(--accent);
        outline-offset: 2px;
    }
    
    /* Better contrast for small text */
    .metric-label,
    .section-label,
    .chat-subtitle {
        color: var(--gray-700);
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Disable animations on mobile for better performance */
    @media (prefers-reduced-motion: no-preference) {
        * {
            animation-duration: 0.2s !important;
        }
    }
    
    /* Reduce shadows for performance */
    * {
        box-shadow: none !important;
    }
    
    /* Optimize transforms */
    .member-card,
    .value-card {
        will-change: auto;
        transform: none !important;
    }
}