/*
 * Blue Ocean Resto — Responsive Design System
 * Mobile-first: 430px → Tablet (768px+) → Desktop (1024px+)
 */

/* ═══════════════════════════════════════════
   SHARED LAYOUT WRAPPERS
   ═══════════════════════════════════════════ */

/* Mobile: centered phone-like shell */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--cream, #fdf6ec);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Status bar hidden on tablet/desktop */
.sb { display: flex; }

/* ═══════════════════════════════════════════
   DESKTOP SIDEBAR NAV (injected via JS)
   ═══════════════════════════════════════════ */
.desktop-sidebar {
  display: none;
}

/* ═══════════════════════════════════════════
   TABLET — 768px and up
   ═══════════════════════════════════════════ */
@media (min-width: 768px) {
  html, body {
    background: #f0f4f8 !important;
  }

  /* Hide mobile status bar */
  .sb { display: none !important; }

  /* Expand app shell */
  .app {
    max-width: 700px;
    border-radius: 20px;
    margin: 24px auto;
    min-height: calc(100dvh - 48px);
    box-shadow: 0 20px 60px rgba(10,37,64,.18);
    overflow: hidden;
  }

  /* Bottom nav stays but gets wider */
  .nav {
    max-width: 700px !important;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 -2px 12px rgba(10,37,64,.08);
  }

  /* Body scroll gets more padding */
  .body-scroll { padding-bottom: 90px; }

  /* Hero sections get more breathing room */
  .hero { padding: 28px 28px 36px !important; }

  /* Quick actions: 4 cols → more spacing */
  .qa-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
  }
  .qa-item { padding: 16px 10px 14px !important; }
  .qa-icon { font-size: 26px !important; }
  .qa-label { font-size: 10px !important; }

  /* Cards get more padding */
  .card { padding: 20px !important; }

  /* Feature cards */
  .feat-card { padding: 18px 20px !important; }

  /* Wallet mini */
  .wallet-mini { padding: 18px 20px !important; }

  /* Content padding */
  .body-pad { padding: 20px !important; }

  /* Form fields get bigger on tablet */
  .field input, .field select, .field textarea {
    padding: 14px 18px !important;
    font-size: 15px !important;
  }

  /* Slot grid — more columns on tablet */
  .slot-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  /* Profile stats */
  .profile-stats {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ═══════════════════════════════════════════
   DESKTOP — 1024px and up
   Full sidebar + content layout
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  html, body {
    background: #0a2540 !important;
  }

  /* Full-width layout wrapper */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a2540 0%, #0e3a5e 50%, #0d5a80 100%);
    z-index: -1;
  }

  /* Desktop layout: sidebar + main content */
  .desktop-layout {
    display: flex !important;
    min-height: 100dvh;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0;
    align-items: flex-start;
  }

  /* Sidebar */
  .desktop-sidebar {
    display: flex !important;
    flex-direction: column;
    width: 240px;
    min-height: 100dvh;
    background: rgba(255,255,255,.04);
    border-right: 1px solid rgba(255,255,255,.08);
    padding: 32px 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
  }

  .desktop-sidebar .sidebar-brand {
    padding: 0 24px 32px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 16px;
  }

  .desktop-sidebar .sidebar-logo {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0ea5a0, #14c4be);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 20px rgba(14,165,160,.4);
    margin-bottom: 12px;
  }

  .desktop-sidebar .sidebar-name {
    font-family: 'Playfair Display', serif;
    font-size: 17px; font-weight: 600;
    color: #fff; line-height: 1.2;
  }

  .desktop-sidebar .sidebar-sub {
    font-size: 11px; color: rgba(255,255,255,.4);
    letter-spacing: .06em; text-transform: uppercase;
    margin-top: 2px;
  }

  .desktop-sidebar .sidebar-nav {
    flex: 1;
    padding: 8px 12px;
  }

  .desktop-sidebar .sidebar-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 12px;
    color: rgba(255,255,255,.55);
    font-size: 14px; font-weight: 500;
    text-decoration: none;
    transition: all .2s;
    margin-bottom: 2px;
    position: relative;
    cursor: pointer;
  }

  .desktop-sidebar .sidebar-item:hover {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.85);
  }

  .desktop-sidebar .sidebar-item.active {
    background: rgba(14,165,160,.15);
    color: #14c4be;
  }

  .desktop-sidebar .sidebar-item .s-icon { font-size: 18px; flex-shrink: 0; }
  .desktop-sidebar .sidebar-item .s-badge {
    margin-left: auto;
    background: #e53e3e; color: #fff;
    border-radius: 50px; font-size: 9px; font-weight: 700;
    padding: 2px 7px; min-width: 18px; text-align: center;
  }

  .desktop-sidebar .sidebar-footer {
    padding: 16px 12px 0;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 8px;
  }

  /* Main content area */
  .desktop-main {
    flex: 1;
    min-height: 100dvh;
    background: #f0f4f8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Desktop header bar */
  .desktop-topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: #fff;
    border-bottom: 1px solid rgba(10,37,64,.08);
    flex-shrink: 0;
  }

  .desktop-topbar .dt-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px; color: #0a1628;
  }

  .desktop-topbar .dt-actions {
    display: flex; align-items: center; gap: 12px;
  }

  .desktop-topbar .dt-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px;
    background: #f8f8f8; border-radius: 50px;
    cursor: pointer;
    font-size: 13px; font-weight: 600; color: #0a1628;
  }

  /* App shell becomes the right panel */
  .app {
    max-width: none !important;
    width: 100%;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    min-height: auto;
  }

  /* Hide mobile bottom nav */
  .nav { display: none !important; }

  /* Hide mobile status bar */
  .sb { display: none !important; }

  /* Content scrolls */
  .body-scroll {
    padding-bottom: 40px !important;
    background: #f0f4f8;
  }

  /* Body content pads wider */
  .body-pad { padding: 28px 32px !important; }

  /* Hero redesigned for desktop */
  .hero {
    padding: 32px 32px 40px !important;
    border-radius: 0 !important;
  }

  /* Quick actions grid: 8 cols on desktop */
  .qa-grid {
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 12px !important;
  }

  /* Two-column card layout for desktop */
  .desktop-two-col {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .desktop-three-col {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
  }

  /* Slot grid: 6 cols */
  .slot-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }

  /* Forms centered and max-width contained */
  .form-container {
    max-width: 600px;
  }

  /* Pay bill: side-by-side layout */
  .pay-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  /* Card get better shadows */
  .card {
    padding: 24px !important;
    border-radius: 16px !important;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE TYPOGRAPHY SCALING
   ═══════════════════════════════════════════ */
@media (min-width: 768px) {
  .section-title { font-size: 20px !important; }
}

@media (min-width: 1024px) {
  .section-title { font-size: 22px !important; }
}

/* ═══════════════════════════════════════════
   DESKTOP UTILITY CLASSES
   ═══════════════════════════════════════════ */
.desktop-only { display: none; }
.mobile-only  { display: flex; }

@media (min-width: 1024px) {
  .desktop-only { display: flex; }
  .mobile-only  { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .tablet-only { display: flex; }
}

/* ═══════════════════════════════════════════
   DESKTOP: App-shell override
   When inside .desktop-main, app fills the space
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  .desktop-layout {
    min-height: 100dvh;
  }

  .desktop-main .app {
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .desktop-main .body-scroll {
    overflow-y: auto;
    max-height: calc(100dvh - 72px);
  }

  .desktop-main .body-pad {
    padding: 28px 32px !important;
    max-width: 960px;
  }

  /* Hero bar: show back as breadcrumb on desktop */
  .desktop-main .hero {
    padding: 24px 32px 32px !important;
  }

  /* Two column for feature sections */
  .desktop-main .feat-card {
    padding: 18px 20px !important;
  }

  /* Payment page: bill + methods side by side */
  .desktop-main .body-scroll > div > .pay-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }

  /* Profile page: two col */
  .desktop-main .profile-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
    padding: 28px 32px;
  }

  /* Wallet: side by side */
  .desktop-main .wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }

  /* Table booking form: wider */
  .desktop-main .slot-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }

  /* Cards: slightly elevated look */
  .desktop-main .card,
  .desktop-main [style*="border-radius:14px"] {
    box-shadow: 0 2px 12px rgba(10,37,64,.07), 0 0 0 1px rgba(10,37,64,.04) !important;
  }
}

/* ═══════════════════════════════════════════
   TABLET: Two-column quick actions in hero
   ═══════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Wallet hero: side by side */
  .wallet-hero-inner {
    display: flex;
    gap: 16px;
  }
  .wallet-hero-inner > * { flex: 1; }

  /* Table booking: 2 col form grid */
  .booking-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* ═══════════════════════════════════════════
   MENU PAGE — special responsive treatment
   (menu.html has its own wide layout already)
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  /* Menu page already wide-layout, just set max-width */
  body.page-menu .desktop-main .body-scroll {
    background: #f6f9fc;
  }
}

/* ═══════════════════════════════════════════
   SCROLLBAR STYLING (desktop)
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  .body-scroll::-webkit-scrollbar { width: 6px; }
  .body-scroll::-webkit-scrollbar-track { background: transparent; }
  .body-scroll::-webkit-scrollbar-thumb {
    background: rgba(10,37,64,.15);
    border-radius: 3px;
  }
  .body-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(10,37,64,.25);
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE NAV BADGE — tablet
   ═══════════════════════════════════════════ */
@media (min-width: 768px) {
  .nav-label { font-size: 10px !important; }
  .nav-icon  { font-size: 22px !important; }
  .nav-item  { padding: 10px 6px 8px !important; }
}

/* ═══════════════════════════════════════════
   INDEX HOME PAGE — desktop two-col layout
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  #home-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    padding: 28px 32px !important;
    max-width: none;
  }
  /* Wallet mini: full width (span both cols) */
  #home-body > .wallet-mini,
  #home-body > [style*="font-family:'Playfair Display'"][style*="Quick Actions"],
  #home-body > .qa-grid { 
    grid-column: 1 / -1;
  }
  /* Quick Actions title + grid: full width */
  #home-body .qa-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(8, 1fr) !important;
  }
  /* Feature section: right column */
  .desktop-feat-section {
    display: contents;
  }
  .desktop-feat-section .feat-card {
    /* Each card in its own grid cell handled by parent */
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #home-body {
    padding: 20px !important;
  }
  #home-body .qa-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* ═══════════════════════════════════════════
   BILL PAY PAGE — desktop two-col
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  #bill-pay-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
    padding: 28px 32px !important;
  }
  #pay-right-col {
    display: flex;
    flex-direction: column;
  }
  /* Wallet apply card spans left col */
  #bill-pay-body > [style*="Wallet Apply"] {
    grid-column: 1;
  }
}

/* ═══════════════════════════════════════════
   PROFILE PAGE — desktop two-col
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  .desktop-main .body-scroll > .app > .body-scroll > div {
    padding: 28px 32px !important;
  }
}

/* ═══════════════════════════════════════════
   TABLE BOOKING — wider form
   ═══════════════════════════════════════════ */
@media (min-width: 768px) {
  .slot-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}
@media (min-width: 1024px) {
  .slot-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}

/* ═══════════════════════════════════════════
   GENERAL: Better hover states on desktop
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  .qa-item:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(10,37,64,.14) !important;
  }
  .feat-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(10,37,64,.12) !important;
    border-color: rgba(10,37,64,.2) !important;
  }
  .menu-row:hover {
    background: #f5f5f5 !important;
    padding-left: 20px !important;
    transition: all .2s !important;
  }
  .pay-opt:hover {
    border-color: var(--teal) !important;
    box-shadow: 0 4px 16px rgba(14,165,160,.15) !important;
  }
}

/* ═══════════════════════════════════════════
   MENU PAGE DESKTOP — sidebar-aware layout
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  body.page-menu .desktop-layout {
    display: flex;
    min-height: 100dvh;
  }
  body.page-menu .desktop-main {
    flex: 1;
    overflow-x: hidden;
  }
}

/* ═══════════════════════════════════════════
   DESKTOP TOPBAR
   ═══════════════════════════════════════════ */
.desktop-topbar {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: #fff;
    border-bottom: 1px solid rgba(10,37,64,.08);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .desktop-topbar .dt-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 600;
    color: #0a1628;
  }

  .desktop-topbar .dt-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .desktop-topbar .dt-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f0f4f8;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: #0a1628;
    border: 1px solid rgba(10,37,64,.08);
  }

  .desktop-topbar .dt-user:hover {
    background: #e8edf3;
  }
}

/* ═══════════════════════════════════════════
   DESKTOP BACKGROUND
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  html {
    background: #0a2540;
  }
  body {
    background: #0a2540 !important;
  }
  .desktop-layout {
    background: #f0f4f8;
    min-height: 100dvh;
  }
  .desktop-sidebar {
    background: #0a2540;
  }
  .desktop-main {
    background: #f0f4f8;
    flex: 1;
    min-height: 100dvh;
    overflow-y: auto;
  }
  /* App fills main area */
  .desktop-main .app {
    max-width: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  .desktop-main .body-scroll {
    max-height: none;
    background: #f0f4f8;
  }
  /* Hide mobile status bar on desktop */
  .desktop-main .sb {
    display: none !important;
  }
  /* Hide bottom nav on desktop */
  .nav {
    display: none !important;
  }
}
