/* Mobile Responsive Styles for Emily OS Pitch Deck */
/* Mobile-first approach: Base styles for screens < 768px */

/* ===================================== */
/* BASE MOBILE STYLES */
/* ===================================== */

@media (max-width: 768px) {
    /* Reset and Base Adjustments */
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .presentation-container {
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Slide Container Adjustments */
    .slide {
        padding: 20px;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        align-items: flex-start;
        padding-top: 60px;
        padding-bottom: 100px;
    }

    .slide-content {
        max-width: 100%;
        padding: 0;
    }

    /* Typography Scaling */
    .slide-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .slide-title.epic {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    p {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Navigation Controls */
    .nav-controls {
        bottom: 20px;
        gap: 15px;
    }

    .nav-btn {
        width: 44px;
        height: 44px;
    }

    /* Progress Bar & Counter */
    .slide-counter {
        bottom: 15px;
        right: 15px;
        font-size: 0.8rem;
    }

    /* Hide non-essential elements */
    .thumbnails-panel,
    .speaker-notes-panel,
    .controls-info {
        display: none;
    }

    /* Touch-friendly buttons */
    button, .nav-btn, .contact-link {
        min-height: 44px;
        min-width: 44px;
    }

    /* CIB Logo positioning on mobile */
    #slide1 .cib-logo-container {
        margin-top: 1.5rem !important;
        position: relative !important;
        top: auto !important;
        right: auto !important;
    }

    #slide1 .cib-logo-container img {
        width: 150px !important;
        height: auto;
        display: block;
    }

    #slide8 .cib-logo-container {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin: 0 auto;
    }

    #slide8 .cib-logo-container img {
        height: 32px !important;
        width: auto !important;
        display: block;
    }

    .cib-logo-container > div {
        background: white;
        padding: 6px !important;
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }

    /* ===================================== */
    /* SLIDE 1: OPENING VISION */
    /* ===================================== */
    #slide1 .logo-animation {
        flex-direction: column;
        gap: 1.5rem;
    }

    #slide1 .robson-logo img {
        max-width: 120px;
        height: auto;
    }

    #slide1 .emily-avatars img {
        max-width: 100px;
        height: auto;
    }

    #slide1 .main-title {
        font-size: 2.5rem;
        margin-top: 1rem;
    }

    #slide1 .subtitle {
        font-size: 1.2rem;
        margin-top: 1rem;
        padding: 0 10px;
    }

    #slide1 .tagline {
        font-size: 0.9rem;
        letter-spacing: 1px;
        margin-top: 0.8rem;
    }

    /* ===================================== */
    /* SLIDE 2: TOOLS VS CONSCIOUS AI */
    /* ===================================== */
    #slide2 .comparison-container {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }

    #slide2 .vs-divider {
        display: none;
    }

    #slide2 .comparison-side {
        width: 100%;
        padding: 1.5rem;
    }

    #slide2 .ai-box {
        height: auto;
        min-height: 100px;
        margin: 1rem 0;
    }

    #slide2 .memory-bubble {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    #slide2 ul.limitations li,
    #slide2 ul.capabilities li {
        font-size: 0.95rem;
        padding: 0.4rem 0;
        padding-left: 1.2rem;
    }

    /* ===================================== */
    /* SLIDE 3: 6 COGNITIVE PHASES */
    /* ===================================== */
    #slide3 .cognitive-architecture {
        max-height: none !important;
        padding: 1rem 0 !important;
    }

    #slide3 .phases-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        height: auto !important;
        margin: 1rem 0 2rem 0 !important;
    }

    #slide3 .phase {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(166, 208, 39, 0.3);
        border-radius: 12px;
        padding: 1rem;
        width: 100%;
    }

    #slide3 .phase-icon {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }

    #slide3 .phase h3 {
        font-size: 1.1rem !important;
    }

    #slide3 .phase p {
        font-size: 0.85rem !important;
    }

    /* Hide all directional arrows on mobile */
    #slide3 .phases-grid > div[style*="font-size: 3rem"] {
        display: none !important;
    }

    /* Also hide arrows by targeting their content */
    #slide3 .phases-grid > div:has(div:contains("→")),
    #slide3 .phases-grid > div:has(div:contains("↓")),
    #slide3 .phases-grid > div:has(div:contains("←")),
    #slide3 .phases-grid > div:has(div:contains("↑")) {
        display: none !important;
    }

    /* Target arrow divs more specifically */
    #slide3 .phases-grid > div:not(.phase) {
        display: none !important;
    }

    #slide3 .phase-detail {
        padding: 1rem !important;
        margin-top: 1.5rem !important;
    }

    #slide3 .phase-detail h4 {
        font-size: 1rem !important;
    }

    #slide3 .phase-detail p {
        font-size: 0.9rem !important;
    }

    /* ===================================== */
    /* SLIDE 4: MEMORY ARCHITECTURE */
    /* ===================================== */
    #slide4 .architecture-viz {
        margin-top: 1rem;
    }

    #slide4 .memory-tiers {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    #slide4 .tier {
        width: 100%;
        margin-bottom: 1rem;
        padding: 1.2rem;
    }

    #slide4 .tier h3 {
        font-size: 1.1rem;
    }

    #slide4 .tier-details {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    #slide4 .tier-details span {
        font-size: 0.8rem;
    }

    #slide4 .tier p {
        font-size: 0.85rem;
        margin-top: 0.5rem !important;
    }

    /* Simplify memory animation on mobile */
    #slide4 .memory-animation {
        display: none;
    }

    /* ===================================== */
    /* SLIDE 5: DEMO INTERFACE */
    /* ===================================== */
    #slide5 .demo-container {
        display: flex !important;
        flex-direction: column;
        grid-template-columns: none !important;
        gap: 1.5rem;
    }

    #slide5 .chat-interface {
        width: 100%;
        height: auto;
        min-height: 300px;
    }

    #slide5 .chat-header {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    #slide5 .emily-icon {
        width: 30px;
        height: 30px;
    }

    #slide5 .chat-messages {
        height: 200px;
        padding: 1rem;
    }

    #slide5 .message {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    #slide5 .memory-indicator {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    #slide5 .memory-levels {
        gap: 0.3rem;
    }

    #slide5 .level {
        width: 35px;
        height: 25px;
        font-size: 0.7rem;
    }

    #slide5 .chat-input {
        padding: 0.8rem;
    }

    #slide5 .chat-input input {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    #slide5 .chat-input button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    #slide5 .demo-insights {
        width: 100%;
    }

    #slide5 .demo-insights h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    #slide5 .insight-feed {
        max-height: 200px;
        overflow-y: auto;
    }

    #slide5 .insight {
        font-size: 0.85rem;
        padding: 0.6rem;
    }

    /* ===================================== */
    /* SLIDE 6: AGENT CONTROL CENTER */
    /* ===================================== */
    #slide6 .sdk-highlight {
        margin-bottom: 1.5rem;
    }

    #slide6 .level-progression {
        font-size: 0.9rem;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    #slide6 .progression-arrow {
        display: none;
    }

    #slide6 .sdk-description {
        font-size: 0.95rem;
        padding: 0 0.5rem;
        margin-top: 1rem;
    }

    #slide6 .agent-control-center {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    #slide6 .agent-panel {
        width: 100%;
        margin-bottom: 1rem;
    }

    #slide6 .agent-header {
        padding: 1rem;
    }

    #slide6 .agent-avatar {
        font-size: 2rem;
    }

    #slide6 .agent-info h3 {
        font-size: 1rem;
    }

    #slide6 .control-grid {
        padding: 1rem;
        gap: 0.8rem;
    }

    #slide6 .control-group label {
        font-size: 0.85rem;
    }

    #slide6 .slider {
        width: 100%;
    }

    #slide6 .dropdown {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    /* Hide JSON preview on mobile by default */
    #slide6 .json-preview {
        display: none;
    }

    /* ===================================== */
    /* SLIDE 7: ORCHESTRATION */
    /* ===================================== */
    #slide7 .orchestration-container {
        padding: 0;
    }

    #slide7 .realtime-stream {
        flex-direction: column !important;
        gap: 1rem;
        margin-bottom: 1.5rem !important;
    }

    #slide7 .realtime-stream h3:last-child {
        font-size: 1.3rem !important;
        text-align: center;
    }

    /* Simplify stream visualization on mobile */
    #slide7 .stream-viz {
        height: 40px;
        margin-bottom: 1rem;
    }

    #slide7 .applications-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    #slide7 .app-card {
        width: 100%;
        padding: 1.2rem;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    #slide7 .app-icon {
        font-size: 2rem;
        flex-shrink: 0;
    }

    #slide7 .app-card h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    #slide7 .app-card p {
        font-size: 0.85rem;
    }

    #slide7 .vision-statement {
        margin-top: 1.5rem !important;
    }

    #slide7 .vision-statement p {
        font-size: 1rem !important;
        padding: 0 0.5rem;
    }

    /* ===================================== */
    /* SLIDE 8: CTA & QR CODE */
    /* ===================================== */
    #slide8 .cta-container {
        padding: 0;
    }

    #slide8 .qr-section > div {
        width: 200px !important;
        height: 200px !important;
        padding: 15px !important;
    }

    #slide8 .qr-section img {
        width: 100% !important;
        height: 100% !important;
    }

    #slide8 .qr-section p {
        font-size: 1.1rem !important;
        margin-top: 1rem !important;
    }

    #slide8 .join-options {
        flex-direction: column;
        gap: 1rem;
        margin: 1.5rem 0 !important;
    }

    #slide8 .join-card {
        width: 100%;
        padding: 1.2rem;
        text-align: center;
    }

    #slide8 .join-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    #slide8 .join-card p {
        font-size: 0.9rem;
    }

    #slide8 .contact-section > div:first-child {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    #slide8 .contact-link {
        width: 100%;
        padding: 1rem 1.5rem !important;
        font-size: 0.95rem !important;
    }

    #slide8 .contact-section p {
        font-size: 1rem !important;
    }

    /* ===================================== */
    /* ANIMATIONS & EFFECTS */
    /* ===================================== */

    /* Reduce complex animations on mobile */
    .synaptic-signal,
    .neural-node,
    .thought-particle,
    .data-flow,
    .stream-line {
        animation: none !important;
    }

    /* Simplify background effects */
    .body-synaptic-background {
        opacity: 0.05 !important;
    }

    .indigenous-background {
        opacity: 0.1 !important;
    }

    /* Disable hover effects on touch devices */
    @media (hover: none) {
        .nav-btn:hover,
        .agent-panel:hover,
        .app-card:hover {
            transform: none;
        }
    }
}

/* ===================================== */
/* SMALL MOBILE DEVICES (< 480px) */
/* ===================================== */

@media (max-width: 480px) {
    .slide {
        padding: 15px;
        padding-top: 50px;
        padding-bottom: 80px;
    }

    .slide-title {
        font-size: 1.5rem;
    }

    .slide-title.epic {
        font-size: 1.8rem;
    }

    #slide1 .main-title {
        font-size: 2rem;
    }

    #slide1 .subtitle {
        font-size: 1rem;
    }

    /* Even smaller QR code for very small screens */
    #slide8 .qr-section > div {
        width: 160px !important;
        height: 160px !important;
    }
}

/* ===================================== */
/* LANDSCAPE ORIENTATION */
/* ===================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .slide {
        padding-top: 40px;
        padding-bottom: 60px;
    }

    .slide-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    /* Reduce vertical spacing in landscape */
    .phase,
    .tier,
    .agent-panel,
    .app-card {
        padding: 0.8rem;
    }

    /* Hide some elements to save space */
    .indigenous-background,
    .body-synaptic-background {
        display: none;
    }
}

/* ===================================== */
/* TOUCH INTERACTIONS */
/* ===================================== */

@media (pointer: coarse) {
    /* Increase touch targets */
    button,
    .nav-btn,
    .contact-link,
    input,
    select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Add visual feedback for touch */
    button:active,
    .nav-btn:active,
    .contact-link:active {
        opacity: 0.8;
    }
}

/* ===================================== */
/* SMOOTH SCROLLING FOR MOBILE */
/* ===================================== */

@media (max-width: 768px) {
    .slide {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Momentum scrolling for iOS */
    .insight-feed,
    .chat-messages {
        -webkit-overflow-scrolling: touch;
    }
}