/* =============================================================================
   Al Wakrah Fishing – mobile app shell (header / sidebar / tab bar / views)
   ============================================================================= */

:root {
  --app-header-h: 52px;
  --app-tabbar-h: 64px;
  --phone-w: 430px;
  --phone-h: 932px;
  --island-clear: 52px;
}

html, body.app-body {
  overscroll-behavior-y: none;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

/* =============================================================================
   iPhone 15 Pro Max preview frame (desktop / tablet)
   ============================================================================= */
.device-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px 12px;
  box-sizing: border-box;
  background:
    radial-gradient(900px 480px at 50% 0%, rgba(80, 110, 140, 0.18), transparent 58%),
    #12151a;
}

.device-frame {
  position: relative;
  width: var(--phone-w);
  height: min(var(--phone-h), calc(100dvh - 36px));
  border-radius: 54px;
  padding: 11px;
  box-sizing: border-box;
  background: #0c0e12;
  box-shadow:
    0 0 0 1px #2c3138,
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 28px 80px rgba(0, 0, 0, 0.48);
}

.device-island {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 140;
  width: 118px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #0c0e12;
  pointer-events: none;
}

.device-screen {
  position: relative;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(255, 236, 210, 0.55), transparent 55%),
    radial-gradient(1000px 600px at 92% 0%, rgba(186, 224, 245, 0.55), transparent 50%),
    linear-gradient(155deg, #FDF8F0 0%, #F5F0E8 38%, #E8F4FC 100%);
}

html[data-theme="dark"] .device-screen {
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(18, 130, 162, 0.2), transparent 50%),
    linear-gradient(180deg, #04141c 0%, #071820 100%);
}

.app-header {
  position: relative;
  z-index: 80;
  flex: 0 0 auto;
  padding-top: var(--island-clear);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: var(--app-header-h);
  padding: 0.2rem 0.65rem 0.55rem;
  position: relative;
}

.date-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.35rem 0.75rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  z-index: 79;
}

.date-bar-slot {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
}

.date-bar-start {
  justify-content: flex-start;
}

.date-bar-end {
  justify-content: flex-end;
}

.date-bar-end-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#dateBarCalendarToggleBtn.is-collapsed {
  opacity: 0.7;
}

.date-bar-info-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 1rem;
  padding: 0;
  cursor: pointer;
}

.date-bar-info-btn:hover {
  background: var(--sea-100);
}

html[data-theme="dark"] .date-bar-info-btn {
  border-color: rgba(255,255,255,0.15);
  color: #d7e8f0;
}

html[data-theme="dark"] .date-bar-info-btn:hover {
  background: rgba(255,255,255,0.08);
}

.date-bar-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.date-bar-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  padding: 0;
  cursor: pointer;
}

.date-bar-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-bar-btn:hover:not(:disabled) {
  background: var(--sea-100);
}

.date-bar-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Inter', 'Cairo', sans-serif;
  letter-spacing: 0.01em;
  min-width: 7.5rem;
  text-align: center;
}

.date-bar-date-btn {
  border: none;
  background: transparent;
  padding: 0.15rem 0.35rem;
  border-radius: 0.45rem;
  cursor: pointer;
  line-height: 1.2;
}

.date-bar-date-btn:hover:not(:disabled) {
  background: var(--sea-100);
}

.date-bar-date-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

html[data-theme="dark"] .date-bar-date-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
}

html[data-theme="dark"] .date-bar {
  background: rgba(12, 36, 48, 0.85);
  border-color: rgba(255,255,255,0.1);
}

html[data-theme="dark"] .date-bar-btn {
  border-color: rgba(255,255,255,0.15);
  color: #d7e8f0;
}

html[data-theme="dark"] .date-bar-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
}

.app-header .brand-icon {
  display: none;
}

.app-header .app-title {
  font-size: 1.98rem;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.app-header .app-subtitle {
  font-size: 0.68rem;
  gap: 0.2rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.app-header .app-subtitle .fixed-badge {
  flex-shrink: 0;
}

.app-header .header-actions {
  gap: 0.32rem !important;
  z-index: 1;
}

.app-header .btn-theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  box-shadow: 0 2px 8px rgba(26, 60, 90, 0.08);
}

.app-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  container-type: size;
  container-name: appscroll;
}

body.is-sidebar-open .app-scroll {
  overflow: hidden;
}

.device-screen main.container-fluid {
  max-width: none !important;
  width: 100%;
}

.app-iconbtn {
  appearance: none;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--sea-800);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(26, 60, 90, 0.08);
  cursor: pointer;
}

.app-iconbtn i { font-size: 1.12rem; }

.app-iconbtn:focus-visible {
  outline: 2px solid var(--sea-500);
  outline-offset: 2px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.app-brand-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 62%;
  justify-content: center;
  pointer-events: none;
}

.app-header .header-actions {
  margin-inline-start: auto;
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: block;
}

#view-about.app-view.is-active {
  display: block;
}

/* ---- Sidebar ---- */
.app-sidebar-backdrop {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(8, 22, 34, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.app-sidebar-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.app-sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  z-index: 130;
  width: min(86%, 320px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 40px rgba(10, 40, 70, 0.18);
  display: flex;
  flex-direction: column;
  padding:
    calc(0.7rem + 28px)
    0.85rem
    0.9rem;
  transform: translateX(105%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

html[dir="ltr"] .app-sidebar {
  transform: translateX(-105%);
}

.app-sidebar.is-open,
html[dir="ltr"] .app-sidebar.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.app-sidebar-head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.2rem 0.15rem 1rem;
  border-bottom: 1px solid rgba(26, 60, 90, 0.08);
}

.app-sidebar-close {
  margin-inline-start: auto;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-top: 0.9rem;
  flex: 1;
}

.app-side-link {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 14px;
  padding: 0.72rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.app-side-link i {
  width: 1.35rem;
  text-align: center;
  color: var(--sea-700);
  font-size: 1.15rem;
}

.app-side-link.is-active,
.app-side-link:hover,
.app-side-link:focus-visible {
  background: rgba(18, 130, 162, 0.1);
  color: var(--sea-800);
  outline: none;
}

.app-sidebar-foot {
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(26, 60, 90, 0.08);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---- Tab bar ---- */
.app-tabbar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  flex: 0 0 auto;
  min-height: var(--app-tabbar-h);
  max-width: none;
  margin: 0;
  transform: none;
  border-radius: 0;
  padding: 0.28rem 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 -10px 28px rgba(26, 60, 90, 0.08);
  direction: rtl;
}

.app-tabbar-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #7a93a6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  font-size: 0.68rem;
  font-weight: 800;
  min-height: 48px;
  border-radius: 14px;
  cursor: pointer;
}

.app-tabbar-item i {
  font-size: 1.28rem;
  line-height: 1;
}

.app-tabbar-item.is-active {
  color: var(--sea-700);
  background: rgba(18, 130, 162, 0.1);
}

.app-tabbar-item:focus-visible {
  outline: 2px solid var(--sea-500);
  outline-offset: -2px;
}

/* ---- About ---- */
.about-hero {
  margin-top: 0.85rem;
  padding: 1.15rem 1rem 1.05rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)),
    var(--glass-bg, rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  text-align: center;
}

.about-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.7rem;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--sea-700), var(--sea-500));
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 8px 20px rgba(10, 77, 104, 0.28);
}

.about-hero h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  color: var(--sea-900);
}

.about-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.about-block {
  margin-top: 0.85rem;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 22px rgba(80, 120, 160, 0.08);
}

.about-block h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 0.65rem;
  color: var(--sea-800);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.about-work {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(26, 60, 90, 0.08);
  text-decoration: none;
  color: inherit;
}

.about-work:last-child { border-bottom: 0; padding-bottom: 0; }
.about-work:first-of-type { padding-top: 0; }

.about-work-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(18, 130, 162, 0.12);
  color: var(--sea-700);
  font-size: 1.15rem;
}

.about-work h4 {
  margin: 0 0 0.15rem;
  font-size: 0.92rem;
  font-weight: 800;
}

.about-work p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
}

.about-contact {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.about-contact a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--sea-700);
  font-weight: 800;
  text-decoration: none;
  font-size: 0.9rem;
}

/* ---- Dark ---- */
html[data-theme="dark"] .app-iconbtn {
  background: rgba(255, 255, 255, 0.08);
  color: #d7e6ef;
}

html[data-theme="dark"] .app-sidebar {
  background: rgba(12, 28, 40, 0.96);
}

html[data-theme="dark"] .app-side-link { color: #e8f1f6; }
html[data-theme="dark"] .app-side-link i { color: #7ec8e3; }
html[data-theme="dark"] .app-side-link.is-active,
html[data-theme="dark"] .app-side-link:hover {
  background: rgba(126, 200, 227, 0.12);
}

html[data-theme="dark"] .app-tabbar {
  background: rgba(8, 24, 34, 0.94);
  border-top-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .app-tabbar-item.is-active {
  color: #7ec8e3;
  background: rgba(126, 200, 227, 0.12);
}

html[data-theme="dark"] .about-hero,
html[data-theme="dark"] .about-block {
  background: rgba(20, 34, 46, 0.78);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .about-hero h2,
html[data-theme="dark"] .about-block h3,
html[data-theme="dark"] .about-work h4 {
  color: #f0f5f8;
}

html[data-theme="dark"] .app-header-inner {
  min-height: 54px;
}

body.is-sidebar-open {
  overflow: hidden;
}

.device-screen .modal {
  position: absolute;
}
.device-screen .modal-backdrop {
  position: absolute;
}

@media (min-width: 768px) {
  .app-tabbar {
    max-width: none;
    margin: 0;
    left: auto;
    right: auto;
    transform: none;
    border-radius: 0;
  }
}

@media (min-width: 992px) {
  .app-tabbar { max-width: none; }
}

/* Real phone: full bleed, no fake bezel */
@media (max-width: 480px) {
  .device-stage {
    display: block;
    padding: 0;
    min-height: 100dvh;
    background: transparent;
  }
  .device-frame {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }
  .device-island { display: none; }
  .device-screen {
    border-radius: 0;
    height: 100dvh;
  }
  .app-header {
    padding-top: max(10px, env(safe-area-inset-top, 0px));
  }
  .app-tabbar {
    padding-bottom: calc(0.28rem + env(safe-area-inset-bottom, 0px));
  }
  .app-sidebar {
    padding-top: calc(0.7rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
    width: min(86vw, 320px);
  }
}

/* =============================================================================
   Location picker (iOS-style wheel) — multi-spot Qatar fishing
   ============================================================================= */
.app-header .loc-picker-btn {
  max-width: 12.5rem;
}

.loc-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
  margin: 0;
  padding: 0.05rem 0.1rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 8px;
}

.date-bar-loc-btn {
  flex: 0 0 auto;
  border: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 0.3rem;
}

.date-bar-loc-btn .js-location-name {
  max-width: none;
  display: inline !important;
}

.date-bar-loc-btn .bi-geo-alt-fill {
  color: var(--sea-700, #0a4d68);
}

html[data-theme="dark"] .date-bar-loc-btn {
  background: transparent;
}

.loc-picker-btn:focus-visible {
  outline: 2px solid var(--sea-500, #1a9bc4);
  outline-offset: 2px;
}

.loc-picker-btn .js-location-name {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-picker-spin {
  display: none;
  width: 0.8rem;
  height: 0.8rem;
  border-width: 2px;
  flex-shrink: 0;
}

.loc-picker-btn.is-busy .loc-picker-spin {
  display: inline-block;
}

.loc-picker-btn.is-busy .loc-picker-chevron {
  display: none;
}

.loc-picker-overlay {
  position: absolute;
  inset: 0;
  z-index: 135;
  display: flex;
  align-items: flex-end;
  background: rgba(8, 22, 32, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.loc-picker-overlay[hidden] {
  display: none;
}

.loc-picker-sheet {
  width: 100%;
  border-radius: 24px 24px 0 0;
  background: #fff;
  color: #0b1f2a;
  box-shadow: 0 -12px 40px rgba(6, 42, 58, 0.2);
  padding: 0.4rem 1.1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
}

html[data-theme="dark"] .loc-picker-sheet {
  background: #0c2430;
  color: var(--ink);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.loc-picker-handle {
  width: 42px;
  height: 5px;
  border-radius: 99px;
  background: rgba(10, 77, 104, 0.18);
  margin: 0.35rem auto 0.7rem;
}

html[data-theme="dark"] .loc-picker-handle {
  background: rgba(255, 255, 255, 0.18);
}

.loc-picker-title {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
}

.loc-picker-hint {
  margin: 0.25rem 0 0.7rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.loc-wheel-frame {
  position: relative;
  height: 220px;
  margin: 0.15rem 0 0.85rem;
}

.loc-wheel-highlight {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 44px;
  margin-top: -22px;
  border-radius: 12px;
  background: rgba(10, 77, 104, 0.08);
  pointer-events: none;
  z-index: 1;
}

html[data-theme="dark"] .loc-wheel-highlight {
  background: rgba(126, 200, 227, 0.12);
}

.loc-wheel {
  position: relative;
  z-index: 2;
  height: 220px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.loc-wheel::-webkit-scrollbar {
  display: none;
}

.loc-wheel-item {
  height: 44px;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.loc-wheel-item.loc-wheel-spacer {
  pointer-events: none;
  cursor: default;
}

.loc-wheel-item.is-active {
  color: var(--sea-800, #0a4d68);
  font-size: 1.12rem;
  font-weight: 800;
}

html[data-theme="dark"] .loc-wheel-item.is-active {
  color: #d7eef6;
}

.loc-picker-done {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 0.72rem 1rem;
  font-weight: 800;
  font-size: 1rem;
  background: var(--sea-700, #0a4d68);
  color: #fff;
}

html[data-theme="dark"] .loc-picker-done {
  background: #1a9bc4;
  color: #06202a;
}

.date-picker-overlay {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.date-picker-overlay.is-open {
  opacity: 1;
}

.date-picker-overlay .loc-picker-sheet {
  transform: translateY(110%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.date-picker-overlay.is-open .loc-picker-sheet {
  transform: translateY(0);
}

.date-wheels-frame {
  position: relative;
  height: 220px;
  margin: 0.15rem 0 0.85rem;
}

.date-wheels {
  display: flex;
  position: relative;
  z-index: 2;
  height: 220px;
  gap: 0;
}

.date-wheel {
  flex: 1;
  min-width: 0;
}

.date-wheel .loc-wheel-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.2rem;
  font-variant-numeric: tabular-nums;
}

#dateWheelMonth {
  flex: 1.35;
}

html[lang="en"] #dateWheelMonth { order: 1; }
html[lang="en"] #dateWheelDay { order: 2; }
html[lang="en"] #dateWheelYear { order: 3; }
