/**
 * Mobile View - Responsive design for mobile devices
 * Shows intro card at top + timeline content below
 */

/* ============================================
   HIDE DESKTOP ELEMENTS ON MOBILE
   ============================================ */

@media (max-width: 600px) {
  /* Hide desktop-only elements */
  body .background,
  body .video-container,
  body #landingArt,
  body #landingTech,
  body .w-lightbox-backdrop,
  body .w-lightbox-container,
  body .w-lightbox-content {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }
  
  /* Force hide background videos with higher specificity */
  body.bodyindex .background,
  body.bodylight .background {
    display: none !important;
    opacity: 0 !important;
  }

  /* Hide desktop toggle button */
  body .intro-button-col,
  body .view-toggle-btn {
    display: none !important;
  }

  /* Hide ALL desktop timeline sidebar elements */
  body .timeline-trigger,
  body .timeline-sidebar-overlay,
  body .timeline-backdrop,
  body .timeline-close-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Hide ALL creative view content except intro section */
  body #creativeView > *:not(.navigation):not(.introsection):not(.background) {
    display: none !important;
  }

  /* Explicitly hide these elements */
  body .w-layout-grid,
  body .maingrid,
  body .othersgrid,
  body .sidegrid,
  body .fabstudies,
  body .research-heading,
  body .interests,
  body .interestsnote,
  body .block-quote,
  body h1.research-heading,
  body h1.research-heading + * {
    display: none !important;
  }

  /* Force body to light theme on mobile - override both bodyindex and bodylight */
  body,
  body.bodyindex,
  body.bodylight {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%) !important;
    color: #333 !important;
  }

  /* Override view toggle states on mobile */
  body #creativeView {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  /* ============================================
     MOBILE INTRO CARD
     ============================================ */

  /* Force override desktop margin-top */
  body .introsection.intro,
  body.bodyindex .introsection.intro,
  body.bodylight .introsection.intro {
    /* Reset desktop styles */
    margin-top: 0 !important;
    padding: 20px 20px 30px !important;
    gap: 16px;

    /* Glassmorphism effect */
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%) brightness(110%);
    -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(110%);

    /* Glass borders and shadows */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);

    /* Layout */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;

    /* Position */
    position: relative;
    z-index: 100;

    /* Animation */
    transition: none !important;
    transform: none !important;
  }

  /* Photo column - show as small circular avatar */
  body .intro-photo-col {
    width: 100px !important;
    height: 100px !important;
    order: -1;
  }

  body #profilePhoto {
    width: 100px !important;
    height: 100px !important;
    max-height: none !important;
    border-radius: 50% !important;
    border: 3px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3) !important;
  }

  /* Text column */
  body .container.intro-text {
    width: 100%;
    padding: 0;
  }

  body .intro-wrap {
    width: 100%;
    padding: 0;
  }

  /* Name - fixed pixel size */
  body .name-text {
    color: #ff1493 !important;
    font-size: 28px !important;
    font-weight: 700;
    margin-bottom: 8px;
  }

  /* Subtitle with word-swap - fixed pixel size */
  body .paragraph-light {
    color: #333 !important;
    font-size: 16px !important;
    line-height: 1.6;
    margin-bottom: 12px;
  }

  body .paragraph-light span {
    color: #333 !important;
  }

  /* Add line break after "Researcher and Designer of" */
  body .paragraph-light > span:first-child::after {
    content: "\a";
    white-space: pre;
  }

  /* Make the changing text stand out */
  body .paragraph-light #endsSwapVariable {
    font-weight: 600;
    color: #ff1493 !important;
  }

  /* Bio paragraphs - show only first one, fixed pixel size */
  body .heading-jumbo {
    color: #666 !important;
    font-size: 15px !important;
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 12px;
  }

  /* Hide second bio paragraph on mobile (keep third - tech stack) */
  body .intro-wrap .heading-jumbo:nth-of-type(2),
  .intro-wrap .heading-jumbo:nth-of-type(2) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    height: 0 !important;
  }
  
  /* Hide third bio paragraph (tech stack) on mobile */
  body .intro-wrap .heading-jumbo:nth-of-type(3),
  .intro-wrap .heading-jumbo.techstack {
    display: none !important;
  }

  /* Links - horizontal compact buttons */
  body .link-wrap {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0;
    margin-top: 16px;
  }

  body .doclink {
    color: #ff1493 !important;
    font-size: 14px !important;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255, 20, 147, 0.1);
    border: 1px solid rgba(255, 20, 147, 0.3);
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-block;
  }

  body .doclink:hover,
  body .doclink:active {
    background: rgba(255, 20, 147, 0.2);
    border-color: rgba(255, 20, 147, 0.5);
    transform: scale(1.05);
  }

  /* Hide link icons on mobile */
  body .connecticon {
    display: none !important;
  }

  /* Hide text-span (description text before CV link) */
  body .text-span-30 {
    display: none !important;
  }

  /* ============================================
     MOBILE TIMELINE VIEW
     ============================================ */

  /* Timeline container - injected dynamically */
  #mobileTimelineContainer {
    width: 100%;
    padding: 20px 0;
    background: transparent;
  }

  /* Hide filter tags on mobile */
  #mobileTimelineContainer .filter-container {
    display: none !important;
  }

  /* Timeline layout - single column */
  #mobileTimelineContainer .content-wrapper {
    padding: 0 16px !important;
    display: block !important;
  }

  /* Hide left sidebar (year markers) on mobile */
  #mobileTimelineContainer .timeline-sidebar {
    display: none !important;
  }

  /* Year sections */
  #mobileTimelineContainer .year-section {
    margin-bottom: 32px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid rgba(255, 20, 147, 0.2) !important;
  }

  #mobileTimelineContainer .year-section:last-child {
    border-bottom: none !important;
  }

  /* Projects row - single column stack */
  #mobileTimelineContainer .projects-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    margin-bottom: 0 !important;
  }

  /* Project cards - full width, consistent height */
  #mobileTimelineContainer .project-card {
    width: 100% !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1) !important;
    background: white;
  }

  #mobileTimelineContainer .project-card:active {
    transform: scale(0.98);
  }

  /* Project images - consistent aspect ratio */
  #mobileTimelineContainer .project-image {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
  }

  /* Project content - always show title on mobile */
  #mobileTimelineContainer .project-content {
    padding: 12px !important;
    background: white;
  }

  #mobileTimelineContainer .project-title {
    font-size: 16px !important;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
  }

  /* Force show title even for low importance projects */
  #mobileTimelineContainer .project-card .project-content {
    display: block !important;
  }

  /* Add year labels inline (since sidebar is hidden) - fixed pixel size */
  #mobileTimelineContainer .year-section::before {
    content: attr(data-year);
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #ff1493;
    margin-bottom: 16px;
    text-align: left;
  }

  /* ============================================
     MOBILE NAVIGATION
     ============================================ */

  /* Hide navigation entirely on mobile */
  body .navigation {
    display: none !important;
  }

  /* Remove any spacing at top */
  body #creativeView {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
}

/* ============================================
   SMALL MOBILE (< 480px)
   ============================================ */

@media (max-width: 400px) {
  body .introsection.intro {
    padding: 16px 16px 24px !important;
    border-radius: 12px;
  }

  /* Keep readable pixel sizes even on very small screens */
  body .name-text {
    font-size: 24px !important;
  }

  body .paragraph-light {
    font-size: 15px !important;
  }

  body .heading-jumbo {
    font-size: 14px !important;
  }

  body .doclink {
    font-size: 13px !important;
    padding: 6px 12px;
  }

  #mobileTimelineContainer .filter-container {
    padding: 0 12px 16px !important;
  }

  #mobileTimelineContainer .content-wrapper {
    padding: 0 12px !important;
  }

  #mobileTimelineContainer .project-image {
    height: 180px !important;
  }
}

/* ============================================
   EXTRA SMALL MOBILE (< 375px - iPhone SE)
   ============================================ */

@media (max-width: 360px) {
  /* Small circular avatar for tiny screens */
  body .intro-photo-col {
    width: 80px !important;
    height: 80px !important;
  }

  body #profilePhoto {
    width: 80px !important;
    height: 80px !important;
  }

  /* Very small screens - maintain minimum readability */
  body .name-text {
    font-size: 22px !important;
  }

  body .paragraph-light {
    font-size: 14px !important;
  }

  body .heading-jumbo {
    font-size: 13px !important;
  }

  #mobileTimelineContainer .project-image {
    height: 160px !important;
  }
}
