/* ==========================================================================
   Skora AI - Mobile Top Header & Bottom Navigation Bar & Sheets
   Matches Screenshots SS1, SS2, SS3:
   - SS1: Mobile top bar (sparkle button + Create pill) and fixed bottom bar
   - SS2: "What do you want to make?" bottom sheet (6 AI tool cards + Explore)
   - SS3: "More" navigation bottom sheet (Studio app card + 8 grid buttons + links)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Desktop Default (> 768px): Hide all mobile navigation elements
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
  .skora-bottom-nav,
  .skora-sheet-backdrop,
  .skora-bottom-sheet {
    display: none !important;
  }
  .header-action-flame {
    display: none !important;
  }
  .mobile-only-text {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile View (<= 768px): Top Header & Bottom Fixed Navigation
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Prevent content hiding behind fixed bottom nav */
  body {
    padding-bottom: 78px !important;
  }

  /* Prevent page scroll when bottom sheet is open */
  html.sheet-locked,
  body.sheet-locked {
    overflow: hidden !important;
    touch-action: none;
  }

  .desktop-only-text {
    display: none !important;
  }

  /* ------------------------------------------------------------------------
     1. Top Header Adjustments (SS1)
     ------------------------------------------------------------------------ */
  .site-header {
    height: 64px !important;
  }

  .site-header .wrap {
    padding: 0 14px !important;
  }

  .site-header .logo-img {
    height: 38px !important;
    width: auto !important;
  }

  /* Hide the old hamburger toggle in favor of bottom nav */
  .nav-toggle {
    display: none !important;
  }

  /* Show header action buttons on mobile */
  .header-actions {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  /* Sparkle button: round dark circle with subtle glow and border */
  .header-action-flame {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 94, 58, 0.25);
    color: #ff5e3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 12px rgba(255, 94, 58, 0.15);
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0 !important;
  }

  .header-action-flame:hover,
  .header-action-flame:active {
    background: rgba(255, 94, 58, 0.15);
    border-color: rgba(255, 94, 58, 0.5);
    transform: scale(1.05);
  }

  /* Header Create button: pill gradient matching SS1 */
  .btn-header-create {
    padding: 6px 15px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #ff5e3a, #ff2a6d) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 3px 12px rgba(255, 94, 58, 0.45) !important;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .btn-header-create:hover,
  .btn-header-create:active {
    opacity: 0.94;
    transform: scale(0.98);
  }

  /* ------------------------------------------------------------------------
     CTA Band Responsive (Mobile View)
     ------------------------------------------------------------------------ */
  .cta-band-section {
    margin-top: 50px !important;
    margin-bottom: 30px !important;
    padding: 0 16px !important;
  }

  .cta-band-card {
    padding: 38px 20px !important;
    border-radius: 20px !important;
  }

  .cta-band-title {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
    margin-bottom: 14px !important;
  }

  .cta-band-desc {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    margin-bottom: 26px !important;
  }

  .cta-band-buttons {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .cta-band-buttons .btn {
    width: 100% !important;
    max-width: 320px !important;
    padding: 13px 20px !important;
    font-size: 0.95rem !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* ------------------------------------------------------------------------
     2. Fixed Bottom Navigation Bar (SS1 Exact Match)
     ------------------------------------------------------------------------ */
  .skora-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 58px;
    background: #090a0d !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px calc(env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.85);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #787d8d;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.15s ease;
    font-family: var(--font-body, 'Inter', sans-serif);
    -webkit-tap-highlight-color: transparent;
    width: 68px;
  }

  .bottom-nav-item .bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }

  .bottom-nav-item .bottom-nav-icon svg {
    stroke: currentColor;
    transition: stroke 0.2s ease, transform 0.2s ease;
  }

  .bottom-nav-item .bottom-nav-label {
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  /* Active state (reddish-coral tint like SS1 Home) */
  .bottom-nav-item.active {
    color: #ff5533;
    font-weight: 600;
  }

  .bottom-nav-item.active .bottom-nav-icon svg {
    stroke: #ff5533;
  }

  .bottom-nav-item:active {
    transform: scale(0.92);
  }

  /* Center Floating (+) Squircle Button Wrap */
  .bottom-nav-create-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    position: relative;
  }

  /* Center Floating (+) Squircle Button with Radial Glow Halo (SS1 Exact) */
  .bottom-nav-create-btn {
    width: 50px;
    height: 50px;
    border-radius: 17px;
    background: linear-gradient(180deg, #ff5744 0%, #ff2d55 100%);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 28px 6px rgba(255, 87, 68, 0.55), 0 4px 14px rgba(0, 0, 0, 0.4);
    transform: translateY(-14px);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-create-btn svg {
    stroke: #ffffff;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .bottom-nav-create-btn:hover,
  .bottom-nav-create-btn.active {
    box-shadow: 0 0 36px 8px rgba(255, 87, 68, 0.7), 0 4px 16px rgba(0, 0, 0, 0.5);
  }

  .bottom-nav-create-btn:active {
    transform: translateY(-14px) scale(0.92);
  }

  /* ------------------------------------------------------------------------
     3. Bottom Sheets Backdrop Overlay
     ------------------------------------------------------------------------ */
  .skora-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .skora-sheet-backdrop.active {
    opacity: 1;
    visibility: visible;
  }

  /* ------------------------------------------------------------------------
     4. Bottom Sheet Base Styles
     ------------------------------------------------------------------------ */
  .skora-bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: #111215;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px 24px 0 0;
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.85);
  }

  .skora-bottom-sheet.active {
    transform: translateY(0);
  }

  /* Drag handle bar */
  .sheet-drag-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    margin: 10px auto 4px;
    flex-shrink: 0;
  }

  /* Sheet Header */
  .sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
  }

  .sheet-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-display, 'Outfit', sans-serif);
    letter-spacing: -0.01em;
    margin: 0;
  }

  .sheet-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 50 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    flex-shrink: 0;
  }

  .sheet-close-btn svg {
    pointer-events: none;
  }

  .sheet-close-btn:hover,
  .sheet-close-btn:active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    transform: scale(1.05);
  }

  .sheet-content {
    padding: 16px 18px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  /* ------------------------------------------------------------------------
     5. SS2 "What do you want to make?" Grid & Cards
     ------------------------------------------------------------------------ */
  .sheet-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .sheet-tool-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #17181c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 14px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
  }

  .sheet-tool-card:hover,
  .sheet-tool-card:active {
    background: #1f2026;
    border-color: rgba(255, 94, 58, 0.35);
    transform: translateY(-2px);
  }

  .sheet-tool-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
  }

  /* Card Icon Background Colors matching SS2 */
  .icon-coral {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
  }

  .icon-cyan {
    background: linear-gradient(135deg, #00f2fe, #00c6ff);
    color: #07080a;
  }

  .icon-cyan svg {
    stroke: #07080a;
  }

  .icon-purple {
    background: linear-gradient(135deg, #a855f7, #ec4899);
  }

  .icon-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
  }

  .icon-teal {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
  }

  .icon-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
  }

  .sheet-tool-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .sheet-tool-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    font-family: var(--font-body, 'Inter', sans-serif);
  }

  .sheet-tool-desc {
    font-size: 0.74rem;
    color: #9ca3af;
    line-height: 1.3;
    font-family: var(--font-body, 'Inter', sans-serif);
  }

  /* Explore All Banner at bottom of SS2 */
  .sheet-explore-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 94, 58, 0.05);
    border: 1px solid rgba(255, 94, 58, 0.25);
    text-decoration: none;
    color: #ffffff;
    margin-top: 4px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .sheet-explore-banner:hover,
  .sheet-explore-banner:active {
    background: rgba(255, 94, 58, 0.12);
    border-color: rgba(255, 94, 58, 0.45);
    transform: translateY(-1px);
  }

  .explore-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .explore-bolt {
    font-size: 1.15rem;
    color: #fbbf24;
  }

  .explore-banner-text {
    font-size: 0.94rem;
    font-weight: 600;
    color: #f3f4f6;
    font-family: var(--font-body, 'Inter', sans-serif);
  }

  .explore-arrow {
    color: #ff5e3a;
    transition: transform 0.2s ease;
  }

  .sheet-explore-banner:hover .explore-arrow,
  .sheet-explore-banner:active .explore-arrow {
    transform: translateX(4px);
  }

  /* ------------------------------------------------------------------------
     6. SS3 "More" Sheet: Featured Card, 8 Buttons Grid & Legal Links
     ------------------------------------------------------------------------ */
  .sheet-app-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #17181c;
    border: 1px solid rgba(255, 94, 58, 0.22);
    text-decoration: none;
    color: #ffffff;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  button.sheet-app-card {
    width: 100%;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .sheet-app-card[hidden] {
    display: none;
  }

  .sheet-app-card:hover,
  .sheet-app-card:active {
    background: #1c1d22;
    border-color: rgba(255, 94, 58, 0.4);
  }

  .sheet-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(255, 65, 108, 0.4);
  }

  .sheet-app-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .sheet-app-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-body, 'Inter', sans-serif);
  }

  .sheet-app-sub {
    font-size: 0.78rem;
    color: #9ca3af;
    line-height: 1.3;
    font-family: var(--font-body, 'Inter', sans-serif);
  }

  /* 2-Column Buttons Grid (SS3) */
  .sheet-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
  }

  .sheet-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 12px;
    border-radius: 12px;
    background: #1c1d22;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.18s ease;
    font-family: var(--font-body, 'Inter', sans-serif);
    -webkit-tap-highlight-color: transparent;
  }

  .sheet-nav-btn:hover,
  .sheet-nav-btn:active {
    background: #25262c;
    border-color: rgba(255, 94, 58, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
  }

  /* Secondary Legal & Support links (SS3) */
  .sheet-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 0 4px;
    margin-top: 4px;
  }

  .sheet-footer-links a {
    color: #6b7280;
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.2s ease;
    font-family: var(--font-body, 'Inter', sans-serif);
  }

  .sheet-footer-links a:hover,
  .sheet-footer-links a:active {
    color: #d1d5db;
  }
}
