/* ════════════════════════════════════════════════
   موعد — قالب لعبة 3D (style.css)
   RTL · أرقام لاتينية · لوحات محطات المعلومات
   ════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #0b7961;
  --primary-dark: #096650;
  --accent: #a98552;
  --ink: #22303a;
  --muted: #6b7885;
  --card: #fffdf9;
  --err: #e05a5a;
  --line: #e6e0d4;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: #dfe8ee;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game-canvas { display: block; width: 100vw; height: 100vh; }

/* ── HUD علوي ── */
#hud-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; pointer-events: none;
}
#hud-title {
  background: rgba(34, 48, 58, 0.62); color: #fff;
  padding: 9px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 700; backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
#status-chip {
  background: rgba(255,255,255,0.9); color: var(--ink);
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 800; backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ── تعليمات ── */
#controls-help {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(34, 48, 58, 0.5); color: #fff;
  padding: 7px 16px; border-radius: 999px;
  font-size: 12.5px; z-index: 10; pointer-events: none; text-align: center;
  backdrop-filter: blur(8px); white-space: nowrap;
}

/* ── تلميح التفاعل ── */
#interact-hint {
  position: fixed; top: 40%; left: 50%; transform: translateX(-50%);
  display: none; align-items: center; gap: 10px; z-index: 12; pointer-events: none;
  background: var(--primary); color: #fff;
  padding: 11px 20px 11px 14px; border-radius: 14px;
  font-size: 17px; font-weight: 800;
  box-shadow: 0 10px 30px rgba(11, 121, 97, 0.45);
  animation: bob 1.3s ease-in-out infinite;
}
.hint-key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px;
  background: rgba(255,255,255,0.25); border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 8px; font-size: 16px; font-weight: 900;
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-7px); } }

/* ── عصا التحكّم (جوال) ── */
#joystick {
  position: fixed; bottom: 42px; right: 40px;
  width: 138px; height: 138px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.22), rgba(255,255,255,0.1));
  border: 2px solid rgba(255,255,255,0.45);
  z-index: 15; touch-action: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
#joystick-knob {
  position: absolute; top: 50%; left: 50%;
  width: 60px; height: 60px; margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: rgba(11, 121, 97, 0.92);
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}
#action-btn {
  position: fixed; bottom: 62px; left: 40px;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: 3px solid #fff; font-size: 16px; font-weight: 800;
  z-index: 15; cursor: pointer; touch-action: none;
  box-shadow: 0 6px 20px rgba(11, 121, 97, 0.42);
}
#action-btn.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.09); box-shadow: 0 10px 30px rgba(11,121,97,0.6); } }

.mobile-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .mobile-only { display: flex; }
  .pc-only { display: none; }
  #controls-help { font-size: 11.5px; }
}

/* ════════════════════════════════════════════════
   لوحات عامّة (الحجز + المعلومات)
   ════════════════════════════════════════════════ */
#booking-layer, #info-panel {
  position: fixed; inset: 0; z-index: 20;
  display: none; align-items: center; justify-content: center;
  background: rgba(28, 38, 46, 0.55); backdrop-filter: blur(5px);
  padding: 16px;
}
#booking-layer.open, #info-panel.open { display: flex; }

#booking-panel, #info-card {
  position: relative;
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 22px;
  box-shadow: 0 26px 64px rgba(0,0,0,0.38);
  animation: pop 0.24s ease; direction: rtl;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── لوحة الحجز ── */
#booking-panel { padding: 28px 24px 24px; }
#close-menu {
  position: absolute; top: 14px; left: 16px;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: #f0ece2; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer;
}
#close-menu:hover { background: #e6e0d0; }
#booking-panel h2 { color: var(--ink); font-size: 22px; margin-bottom: 4px; }
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.field-group { margin-bottom: 14px; }
.field-label { display: block; color: var(--ink); font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff;
  transition: border-color 0.15s;
}
.field-input:focus { outline: none; border-color: var(--primary); }
.field-input.err { border-color: var(--err); }
select.field-input { cursor: pointer; }
textarea.field-input { resize: vertical; min-height: 52px; }
.radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-opt { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--ink); }
.radio-opt:has(input:checked) { border-color: var(--primary); background: #f0f8f5; }
.field-error { color: var(--err); font-size: 13px; margin-top: 5px; min-height: 1px; }

.primary-btn {
  width: 100%; padding: 14px; margin-top: 6px;
  background: var(--primary); color: #fff; border: none; border-radius: 14px;
  font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.primary-btn:hover { background: var(--primary-dark); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled { opacity: 0.7; cursor: default; }
#turnstile-container { min-height: 65px; display: flex; }

#booking-success { display: none; text-align: center; padding: 28px 24px; }
.success-icon { width: 72px; height: 72px; margin: 0 auto 16px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 900; }
#booking-success h2 { margin-bottom: 8px; color: var(--ink); }
#booking-success p { color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.patient-number { font-size: 44px; font-weight: 900; color: var(--primary); margin: 10px 0 6px; letter-spacing: 1px; }
.success-note { font-size: 13px !important; margin: 8px 0 20px !important; }

/* ════════════════════════════════════════════════
   لوحة المعلومات (محطات)
   ════════════════════════════════════════════════ */
#info-header {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px;
  background: linear-gradient(180deg, var(--card) 70%, rgba(255,253,249,0));
}
#info-title { color: var(--ink); font-size: 21px; }
#info-close {
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: #f0ece2; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
#info-close:hover { background: #e6e0d0; }
#info-body { padding: 4px 22px 24px; }
.ip-empty { color: var(--muted); text-align: center; padding: 28px 0; font-size: 15px; }
.ip-section-title { font-size: 13px; font-weight: 800; color: var(--primary); margin: 18px 0 10px; letter-spacing: .3px; }

/* الطبيب */
.ip-doctor { text-align: center; }
.ip-avatar { width: 96px; height: 96px; margin: 4px auto 12px; }
.ip-avatar-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); }
.ip-avatar-letter { width: 96px; height: 96px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: 900; }
.ip-doctor-name { font-size: 20px; font-weight: 800; color: var(--ink); }
.ip-badge { display: inline-block; margin-top: 6px; padding: 4px 14px; background: #f0f8f5; color: var(--primary); border-radius: 999px; font-size: 13px; font-weight: 700; }
.ip-bio { color: var(--muted); font-size: 14.5px; line-height: 1.75; margin: 12px 0; }
.ip-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 11px 20px; background: var(--primary); color: #fff; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 15px; }
.ip-btn:hover { background: var(--primary-dark); }
.ip-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; }
.ip-team-card { text-align: center; font-size: 13px; color: var(--ink); }
.ip-team-avatar { width: 64px; height: 64px; margin: 0 auto 6px; }
.ip-team-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.ip-team-letter { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; }

/* الخدمات */
.ip-services { display: flex; flex-direction: column; gap: 10px; }
.ip-service { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; background: #faf7f0; border: 1px solid var(--line); border-radius: 14px; }
.ip-service-num { color: var(--primary); font-weight: 900; font-size: 15px; opacity: .8; }
.ip-service-name { font-weight: 700; color: var(--ink); font-size: 15.5px; }
.ip-service-desc { color: var(--muted); font-size: 13.5px; margin-top: 3px; line-height: 1.6; }

/* الموقع + الخريطة */
.ip-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; color: var(--ink); }
.ip-row a { color: var(--primary); text-decoration: none; font-weight: 700; }
.ip-ic { font-size: 18px; }
.ip-map { width: 100%; height: 240px; border: 0; border-radius: 14px; margin: 12px 0; background: #eee; }

/* ساعات + حالة */
.ip-status { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; }
.ip-status-open { background: #e9f9ef; }
.ip-status-closed { background: #fdecec; }
.ip-status-vacation { background: #fdf3e2; }
.ip-status-emoji { font-size: 34px; }
.ip-status-title { font-weight: 800; font-size: 17px; color: var(--ink); }
.ip-status-detail { color: var(--muted); font-size: 13.5px; margin-top: 3px; line-height: 1.6; }
.ip-hours { display: flex; flex-wrap: wrap; gap: 8px; }
.ip-hour-chip { background: #f0f8f5; color: var(--ink); padding: 8px 14px; border-radius: 10px; font-size: 14px; }
.ip-hour-chip b { color: var(--primary); }
.ip-days { display: flex; flex-wrap: wrap; gap: 6px; }
.ip-day { background: #faf7f0; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--ink); }
.ip-note { margin-top: 14px; padding: 12px 14px; background: #fdf3e2; border-radius: 12px; font-size: 14px; color: var(--ink); }

/* المعرض */
.ip-gallery { display: flex; flex-direction: column; gap: 16px; }
.ip-gallery-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ip-gallery-side { position: relative; border-radius: 12px; overflow: hidden; background: #eee; aspect-ratio: 1; }
.ip-gallery-side img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ip-gallery-tag { position: absolute; top: 8px; right: 8px; background: rgba(11,121,97,0.9); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ip-gallery-cap { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 6px; }

/* FAQ */
.ip-faq { display: flex; flex-direction: column; gap: 8px; }
.ip-faq-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #faf7f0; }
.ip-faq-item summary { padding: 13px 15px; font-weight: 700; color: var(--ink); font-size: 15px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.ip-faq-item summary::-webkit-details-marker { display: none; }
.ip-faq-item summary::after { content: '+'; color: var(--primary); font-weight: 900; font-size: 20px; }
.ip-faq-item[open] summary::after { content: '−'; }
.ip-faq-item p { padding: 0 15px 14px; color: var(--muted); font-size: 14px; line-height: 1.75; }

@media (max-width: 480px) {
  .field-input { font-size: 16px; }
  .ip-map { height: 200px; }
}
