/* Mobile Enhancements - Comprehensive Mobile Responsiveness */

:root {
  --mobile-banner-height: 0px;
}

.desktop-suggestion-banner {
  display: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.desktop-suggestion-banner.is-hidden {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

/* Global Mobile Fixes */
@media (max-width: 767px) {
  :root {
    --mobile-banner-height: var(--space-6);
  }

  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
  }
  
  /* Improve text readability */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  html {
    scroll-padding-top: calc(72px + var(--mobile-banner-height));
  }

  .desktop-suggestion-banner {
    display: flex;
    position: fixed;
    top: var(--space-9);
    left: 0;
    right: 0;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--mobile-banner-height);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    color: var(--color-gray-700);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-align: center;
    box-shadow: 0 18px 30px -24px rgba(17, 24, 39, 0.35);
  }

  .desktop-suggestion-banner[hidden] {
    display: none !important;
  }

  .desktop-suggestion-banner__icon {
    width: 20px;
    height: 20px;
    color: var(--color-gray-500);
  }

  .desktop-suggestion-banner__message {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: var(--tracking-normal);
  }

  .desktop-suggestion-banner__highlight {
    color: var(--color-primary);
    font-weight: var(--font-semibold);
  }

  .desktop-suggestion-banner__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: var(--space-1);
    border: none;
    background: transparent;
    color: var(--color-gray-400);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
  }

  .desktop-suggestion-banner__close i {
    width: 18px;
    height: 18px;
  }

  .desktop-suggestion-banner__close:hover,
  .desktop-suggestion-banner__close:focus-visible {
    background: rgba(17, 24, 39, 0.08);
    color: var(--color-gray-600);
  }

  .desktop-suggestion-banner__close:focus-visible {
    outline: 2px solid rgba(17, 24, 39, 0.12);
    outline-offset: 2px;
  }

  .hero {
    padding-top: calc(var(--space-4) + 72px + var(--mobile-banner-height));
  }

  .navigation__menu {
    top: calc(72px + var(--mobile-banner-height));
  }
  
  /* Better tap targets for all interactive elements */
  a, button, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Prevent zoom on input focus (iOS) */
  input, select, textarea {
    font-size: 16px !important;
  }
  
  /* Section dividers - reduce height on mobile */
  .section-divider {
    height: 40px;
    margin: 0;
  }
  
  /* All sections - ensure proper padding and no overflow */
  section {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    overflow-x: hidden;
  }
  
  /* Hide story and comparison sections completely on mobile */
  .story,
  .comparison {
    display: none !important;
  }
  
  /* Also hide dividers before and after these sections */
  .story + .section-divider,
  .comparison + .section-divider,
  #story,
  #comparison {
    display: none !important;
  }
  
  /* Reduce section padding on mobile */
  .results,
  .youtuber-tool,
  .testimonial,
  .pricing,
  .community,
  .faq {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }

  /* Hide results section entirely on mobile */
  .results,
  #results {
    display: none !important;
  }

  .results + .section-divider {
    display: none !important;
  }
}

/* Mobile Container Adjustments */
@media (max-width: 767px) {
  .container {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
}

/* Mobile Button Improvements */
@media (max-width: 767px) {
  /* All primary CTA buttons */
  .cta-button,
  .auth-button--signup,
  .pricing-card__button,
  .community__button,
  .timeline-step__cta,
  .tool-step__cta {
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
  }
  
  /* Secondary buttons */
  .auth-button--login {
    min-height: 44px;
  }
}

/* Mobile Typography Improvements */
@media (max-width: 767px) {
  /* Section titles */
  h2,
  .results__title,
  .youtuber-tool__title,
  .story__title,
  .comparison__title,
  .pricing__title,
  .community__title,
  .faq__title {
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1.2;
  }
  
  /* Body text */
  p {
    font-size: var(--text-base);
    line-height: 1.6;
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: clamp(24px, 6.5vw, 32px);
  }
  
  p {
    font-size: var(--text-sm);
  }
  
  /* Smaller hero image on small screens */
  .action-image {
    max-height: 220px;
  }
}

@media (max-width: 374px) {
  /* Even smaller on tiny screens */
  .action-image {
    max-height: 180px;
  }
}

/* Mobile Image Optimizations */
@media (max-width: 767px) {
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Hide decorative images and illustrations on mobile (EXCEPT hero action image) */
  .stopwatch-character,
  .community__peek-character,
  .peek-character-image,
  .testimonial__carousel-wrapper::before,
  .tool-step:nth-child(2) .tool-step__visual::after,
  .tool-step:nth-child(4) .tool-step__visual::after,
  .timeline-step__illustration,
  .illustration-img,
  .testimonial__featured-image,
  .testimonial__slide::after,
  .hero__wave-bg {
    display: none !important;
  }
  
  /* KEEP the hero action image - make it responsive */
  .hero__action-image {
    display: block !important;
    max-width: 100%;
    margin-bottom: var(--space-4);
  }
  
  .action-image {
    max-height: 280px;
    width: 100%;
    object-fit: contain;
  }
  
  /* Hide social proof section on mobile */
  .hero__social-proof {
    display: none !important;
  }
  
  /* Keep only essential feature images, make them smaller */
  .tool-step__image {
    width: 100%;
    max-width: 100%;
    object-fit: contain;
    max-height: 200px;
  }
}

/* Mobile Card Improvements */
@media (max-width: 767px) {
  .result-card,
  .pricing-card,
  .faq__item,
  .testimonial__slide {
    border-radius: var(--radius-lg);
    padding: var(--space-4);
  }
  
  /* Improve card spacing in grids */
  .results__grid,
  .pricing__plans {
    gap: var(--space-4);
  }
}

/* Mobile Table/Comparison Improvements */
@media (max-width: 767px) {
  .comparison__table-wrapper {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    margin: 0 calc(-1 * var(--space-4));
    padding: 0 var(--space-4);
  }
  
  .comparison__table-wrapper::before,
  .comparison__table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 2;
  }
  
  .comparison__table-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
  }
  
  .comparison__table-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
  }
}

/* Mobile Timeline Improvements - Simplify heavily */
@media (max-width: 767px) {
  /* Simplify timeline for mobile */
  .timeline-snake-line {
    display: none;
  }
  
  .timeline-step {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: var(--space-6);
  }
  
  .timeline-step__marker {
    left: var(--space-3);
  }
  
  .timeline-step__content {
    font-size: var(--text-sm);
    padding: var(--space-4);
    margin-left: var(--space-8);
  }
  
  .timeline-step__stats {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  
  .timeline-stat {
    padding: var(--space-2);
  }
  
  /* Hide complex thumbnail transitions on mobile */
  .thumbnail-transition {
    display: none;
  }
  
  /* Hide discovered channel visuals */
  .discovered-channel__visual,
  .inspiration-flow {
    display: none;
  }
  
  /* Simplify timeline step visuals */
  .timeline-step--with-illustration {
    display: block;
  }
}

/* Mobile Chat/Community Improvements */
@media (max-width: 767px) {
  .community__chat-preview {
    border-radius: var(--radius-lg);
    max-width: 100%;
  }
  
  .chat-messages {
    font-size: 13px;
  }
  
  .community__visual {
    max-width: 100%;
  }
}

/* Mobile Testimonial Improvements */
@media (max-width: 767px) {
  .testimonial__carousel-wrapper {
    width: 100%;
  }
  
  .testimonial__carousel-nav {
    position: relative;
    left: 0;
    right: 0;
    top: auto;
    transform: none;
    margin-top: var(--space-4);
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    pointer-events: all;
  }
  
  .testimonial__carousel-dots {
    display: flex;
    gap: var(--space-2);
    pointer-events: all;
  }
  
  .testimonial__carousel-arrow {
    position: relative;
    width: 44px;
    height: 44px;
    background: var(--color-gray-100);
    border-radius: 50%;
    pointer-events: all;
  }
  
  .testimonial__carousel-arrow-icon {
    width: 24px;
    height: 24px;
  }
  
  .testimonial__slide {
    padding: var(--space-6) var(--space-4);
  }
}

/* Mobile Footer Improvements */
@media (max-width: 767px) {
  .footer__content {
    text-align: center;
  }
  
  .footer__logo,
  .footer__social-links {
    justify-content: center;
  }
  
  .footer__description {
    text-align: center;
  }
}

/* Mobile Form Improvements */
@media (max-width: 767px) {
  /* Pricing toggle */
  .pricing__toggle {
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
  }
  
  .pricing__toggle-label {
    font-size: var(--text-sm);
  }
}

/* Simplify Tool Steps on Mobile */
@media (max-width: 767px) {
  .tool-step {
    gap: var(--space-3);
  }
  
  .tool-step__content {
    padding: 0;
  }
  
  .tool-step__heading {
    font-size: var(--text-xl);
  }
  
  .tool-step__description {
    font-size: var(--text-sm);
    line-height: 1.6;
  }
  
  .tool-step__visual {
    aspect-ratio: 16 / 9;
    min-height: 180px;
  }
  
  /* Simplify step numbers */
  .tool-step__number {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}

/* Mobile Animation Optimizations */
@media (max-width: 767px) {
  /* Reduce motion for better performance on mobile */
  * {
    animation-duration: 0.3s !important;
    transition-duration: 0.2s !important;
  }
  
  /* Disable complex animations on mobile */
  .result-card:hover,
  .tool-step__visual:hover,
  .timeline-step__content:hover {
    transform: none;
  }
}

/* Improve touch feedback */
@media (max-width: 767px) {
  button:active,
  a:active,
  .nav__link:active,
  .cta-button:active {
    opacity: 0.7;
    transform: scale(0.98);
  }
}

/* Safe area adjustments for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 767px) {
    .navigation {
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }
    
    .footer {
      padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
    }
  }
}

/* Landscape mobile adjustments */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--space-2) + 64px);
    padding-bottom: var(--space-4);
  }
  
  .hero__headline {
    font-size: var(--text-3xl);
  }
  
  .hero__video {
    margin-top: var(--space-2);
  }
}

/* Very small devices (< 375px) */
@media (max-width: 374px) {
  :root {
    font-size: 14px;
  }
  
  .navigation__container {
    padding: 0 var(--space-2);
  }
  
  .hero__headline {
    font-size: var(--text-2xl);
  }
  
  .result-card,
  .pricing-card {
    padding: var(--space-3);
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode support for mobile (if needed in future) */
@media (prefers-color-scheme: dark) and (max-width: 767px) {
  /* Add dark mode styles if needed */
}

/* Accessibility improvements for mobile */
@media (max-width: 767px) {
  /* Larger focus indicators on mobile */
  *:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
  }
  
  /* Better tap highlighting */
  * {
    -webkit-tap-highlight-color: rgba(255, 0, 0, 0.1);
  }
}

