/**
 * NOFI Design System - Responsive Design
 * Mobile-first approach with breakpoints at 768px and 1024px
 */

/* =============================================
   MOBILE (320px - 767px)
   ============================================= */

@media (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Header adjustments */
    .header__inner {
        padding: 0.75rem 0;
        gap: 0.75rem;
    }
    
    .logo__img,
    .header__logo-img {
        height: 36px;
    }
    
    .theme-toggle,
    .mobile-menu-toggle {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }
    
    /* Navigation */
    .nav {
        display: none;
        position: fixed;
        top: var(--header-height, 60px);
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: auto;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        transition: transform 0.3s ease;
        z-index: 99;
        overflow-y: auto;
        padding: 1rem 0;
        transform: translateY(-120%);
    }
    
    .nav--mobile.active {
        display: block;
        transform: translateY(0);
    }
    
    .nav__list {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    .nav__item {
        border-bottom: 1px solid var(--border);
    }
    
    .nav__link {
        display: block;
        padding: 1rem 1.5rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        font-size: 1rem;
    }
    
    .nav__link.active::after {
        display: none;
    }
    
    .nav__link.active {
        background-color: rgba(var(--accent-rgb), 0.1);
        border-left: 3px solid var(--accent);
        padding-left: calc(1.5rem - 3px);
    }
    
    /* Hero section */
    .section--hero {
        padding: 2rem 0;
    }
    
    .hero {
        gap: 2rem;
    }
    
    .hero__title--brand {
        font-size: 2.5rem;
    }
    
    .hero__subtitle {
        font-size: 0.95rem;
    }
    
    .hero__actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero__actions .btn {
        width: 100%;
        min-width: unset;
        justify-content: center;
        min-height: 56px;
    }
    
    .hero__stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat {
        padding: 1rem;
    }
    
    .stat__number {
        font-size: 1.5rem;
    }
    
    /* Sections */
    .section {
        padding: 2rem 0;
    }
    
    .section__title {
        font-size: 1.5rem;
    }
    
    /* Cards */
    .bots-grid,
    .channels-grid,
    .social-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero__stats {
        gap: 1.5rem;
    }
    
    .bot-card {
        border-radius: var(--radius-md);
    }
    
    .bot-card__title {
        font-size: 1rem;
    }
    
    .bot-card__description {
        font-size: 0.85rem;
    }
    
    .bot-card__button {
        width: 100%;
        padding: 0.65rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .bot-card__details {
        padding: 1rem;
    }
    
    .bot-card__qr-container {
        padding: 0.75rem;
    }
    
    .bot-card__qr {
        width: 120px;
        height: 120px;
    }
    
    /* Forms */
    .contact__form {
        padding: 1.5rem;
    }
    
    .form__label {
        font-size: 0.9rem;
    }
    
    .form__input,
    .form__textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.65rem 0.75rem;
    }
    
    .form__textarea {
        min-height: 100px;
    }
    
    .form__submit {
        padding: 0.85rem;
    }
    
    /* Footer */
    .footer__top-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .footer__top-label {
        margin-right: 0;
    }
    
    .footer__main {
        padding: 1.5rem 0;
    }
    
    .footer__grid {
        gap: 1.5rem;
    }
    
    .footer__copy {
        font-size: 0.8rem;
        text-align: center;
    }
    
    /* Utilities */
    .back-to-top {
        width: 2.75rem;
        height: 2.75rem;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.25rem;
    }
    
    /* Typography adjustments */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }
}

/* =============================================
   TABLET (768px - 1023px)
   ============================================= */

@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .hero__title {
        font-size: 2rem;
    }
    
    .hero__subtitle {
        font-size: 1.05rem;
    }
    
    .hero__stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    
    .bots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .channels-grid,
    .social-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section__title {
        font-size: 2rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .contact__form {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* =============================================
   DESKTOP (1024px - 1439px)
   ============================================= */

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
    
    .hero__title {
        font-size: 2.75rem;
    }
    
    .hero__stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .channels-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .social-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .section {
        padding: 3.5rem 0;
    }
    
    .section__title {
        font-size: 2.25rem;
    }
}

/* =============================================
   LARGE DESKTOP (1440px+)
   ============================================= */

@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
        padding: 0 2.5rem;
    }
    
    .hero__title {
        font-size: 3rem;
    }
    
    .hero__subtitle {
        font-size: 1.2rem;
    }
    
    .section__title {
        font-size: 2.5rem;
    }
}

/* =============================================
   PRINT MEDIA
   ============================================= */

@media (max-width: 480px) {
    .auth-modal__box--minimal {
        margin: 1rem;
        padding: 1.5rem 1.25rem;
    }
    .auth-magic__input--code {
        letter-spacing: 0.3em;
        font-size: 1.1rem;
    }
}

@media print {
    .header,
    .footer,
    .back-to-top,
    .mobile-menu-toggle,
    .theme-toggle {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

@media (max-width: 767px) {
  .header__inner {
    grid-template-columns: 1fr auto;
    min-height: 74px;
    gap: 0.75rem;
  }

  .header__brand {
    min-width: 0;
  }

  .header__brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .header__brand-eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
  }

  .header__brand-main {
    font-size: 1.1rem;
  }

  .header__right {
    gap: 0.45rem;
  }

  .nav--header,
  .header__controls,
  .header__auth {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .header__mobile-panel {
    display: none;
    margin-top: 0.35rem;
    padding-bottom: 1rem;
  }

  .header__mobile-panel.active {
    display: block;
  }

  .nav--mobile {
    position: static;
    display: block;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    border-radius: 22px;
    max-height: none;
    overflow: hidden;
  }

  body.light .nav--mobile {
    background: rgba(255, 255, 255, 0.8);
  }

  .nav--mobile .nav__list {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
  }

  .nav--mobile .nav__item {
    border-bottom: 0;
  }

  .nav--mobile .nav__link {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0.95rem 1rem;
    border-radius: 16px;
  }

  .nav--mobile .nav__link.active {
    background: rgba(var(--accent-rgb), 0.12);
    border-left: 0;
    color: var(--accent);
    padding-left: 1rem;
  }

  .header__mobile-actions {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }
}
