/* لاجونا: الهوية المشتركة (الألوان، الخط، رسومات المبنى والمخطط) */

:root {
  /* الهوية: من شعار لاجونا ومن المبنى والبحر */
  --blue: #00A6E6;          /* لون الشعار */
  --blue-ink: #0080B8;      /* نص أزرق مقروء على الأبيض */
  --blue-soft: #E5F5FC;
  --navy: #0A2540;          /* أقمشة المظلات الكحلية وليل البحر */
  --deep: #06324F;
  --ivory: #FBF8F3;         /* رمل الشاطئ */
  --sand: #F1EADF;
  --paper: #FFFFFF;
  --ink: #0B1B2B;
  --muted: #5E6E7D;
  --line: #E7E1D6;
  --glass: #CFE9F6;

  /* حالات الجلسات (يغيرها صاحب المطعم من الثيم) */
  --free: #1E9E6A;
  --free-bg: #E4F4EC;
  --busy: #D64545;
  --busy-bg: #FBE7E6;
  --gold: #B88A3B;
  --gold-bg: #F7EEDC;
  --off: #B9C1C9;
  --off-bg: #F1F2F3;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 27, 43, .05), 0 8px 24px -8px rgba(11, 27, 43, .12);
  --shadow-lg: 0 24px 60px -20px rgba(6, 50, 79, .35);
  --ease: cubic-bezier(.22, .8, .2, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Arabic", "IBM Plex Sans Arabic", "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--ivory); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.num { font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }

/* ——— أيقونات خطية ——— */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ——— الشعار ——— */
.logo { display: block; height: auto; mix-blend-mode: multiply; }
.logo-white { filter: brightness(0) invert(1); mix-blend-mode: screen; }

/* ——— واجهة المبنى ——— */
.building { width: 100%; height: auto; display: block; overflow: visible; }
.building .b-wall { stroke: #E2DCD1; stroke-width: .8; }
.building .b-ledge { fill: #E6E0D5; }
.building .b-win { stroke: #3D8FBF; stroke-width: 2.2; }
.building .b-mullion { stroke: #3D8FBF; stroke-width: 1.6; }
.building .b-mullion.light { stroke: rgba(255,255,255,.55); stroke-width: 1.4; }
.building .b-glint { stroke: rgba(255,255,255,.55); stroke-width: 3; stroke-linecap: round; fill: none; }
.building .b-rail { stroke: #7CC0DE; stroke-width: 1.5; fill: none; stroke-linecap: round; }
.building .b-rail-top { fill: #5FAFD3; }
.building .b-glassrail { fill: rgba(191, 227, 242, .55); stroke: #9CCFE6; stroke-width: 1.2; }
.building .b-sign-t { fill: #fff; font: 800 15px/1 "Inter", var(--font); letter-spacing: .32em; }
.building .b-arch { fill: #fff; stroke: #E2DCD1; stroke-width: 1; }
.building .b-gate { fill: none; stroke: #8CC8E2; stroke-width: 1.6; }
.building .b-pot { fill: #C9B79C; }
.building .b-bush { fill: #5C9561; }
.building .b-garden { stroke: none; }
.building .b-step { fill: #DDD4C4; }
.building .b-grass { stroke: #8DBB7F; stroke-width: 3; stroke-linecap: round; opacity: .7; }
.building .b-picket { fill: #fff; stroke: #E4DED3; stroke-width: .6; }
.building .b-picket-rail { stroke: #fff; stroke-width: 2.4; }
.building .b-string { fill: none; stroke: #8F7A58; stroke-width: .8; opacity: .7; }
.building .b-bulb { fill: #FFD98A; filter: drop-shadow(0 0 2px rgba(255, 196, 90, .9)); }
.building .b-ring { fill: none; stroke: rgba(70, 50, 30, .35); stroke-width: 1; }
.building .b-midrib { fill: none; stroke: rgba(30, 70, 40, .55); stroke-width: .8; }
.building .b-coco { fill: #8A6A3E; }
.building .b-shadow { fill: rgba(80, 60, 30, .14); }
.building .b-beam { stroke: #F4F2EE; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 1px 0 #C9D6DE); }
.building .b-beam.thin { stroke-width: 2.4; }
.building .b-lattice { fill: none; stroke: #D5E3EA; stroke-width: 2; stroke-linejoin: round; }
.building .b-post { stroke: #E9E6E0; stroke-width: 3.4; }

.building .lvl-hit { fill: transparent; transition: fill .3s var(--ease); }
.building .lvl { cursor: pointer; transition: opacity .3s var(--ease), filter .3s var(--ease); }
.building .lvl:hover .lvl-hit, .building .lvl:focus-visible .lvl-hit, .building .lvl.is-active .lvl-hit { fill: rgba(0, 166, 230, .10); }
.building .lvl.is-disabled { cursor: default; opacity: .55; filter: grayscale(.6); }
.building.dim-others .lvl:not(.is-active) { opacity: .45; }

/* نسخة «رسم» تُرسم بالخطوط في المقدمة */
.building.is-sketch * { fill: none !important; stroke: #fff !important; stroke-width: 1.6 !important; }
.building.is-sketch .b-sign-t { fill: #fff !important; stroke: none !important; }
.building.is-sketch path, .building.is-sketch rect { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ——— مخطط الطابق ——— */
.plan { width: 100%; height: auto; display: block; touch-action: none; user-select: none; }
.plan text { letter-spacing: 0; }
.plan .p-wave { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 1.3; animation: wave 7s linear infinite; }
.plan .p-wave2 { stroke: rgba(255, 255, 255, .25); animation-duration: 11s; }
@keyframes wave { to { transform: translateX(60px); } }
.plan .p-sea-pill { fill: rgba(255, 255, 255, .94); }
.plan .p-sea-ic { fill: none; stroke: var(--blue-ink); stroke-width: 1.6; stroke-linecap: round; }
.plan .p-sea-t { fill: var(--blue-ink); font: 700 11px var(--font); }
.plan .pill-l rect { fill: rgba(255, 255, 255, .92); stroke: var(--line); stroke-width: .8; }
.plan .pill-l .pill-t { fill: var(--muted); font: 600 10px var(--font); }
.plan .pill-l.sm .pill-t { font-size: 9px; }
.plan .pill-l.dark rect { fill: var(--ink); stroke: none; }
.plan .pill-l.dark .pill-t { fill: #fff; }
.plan .p-fence { stroke: #D9CDB8; stroke-width: 3; stroke-dasharray: 1.5 5; stroke-linecap: round; }
.plan .p-walk { stroke: #E8DFCF; stroke-width: 40; }
.plan .p-stone { fill: #D9CFBD; }
.plan .p-lights { fill: none; stroke: #A08A66; stroke-width: .8; opacity: .6; }
.plan .p-bulb { fill: #FFD27A; filter: drop-shadow(0 0 2.5px rgba(255, 190, 80, .95)); }
.plan .p-wall { stroke: #33465A; stroke-width: 5; }
.plan .p-inner { stroke: #33465A; stroke-width: 3; stroke-linecap: round; }
.plan .p-glass { stroke: #9CD3EC; stroke-width: 4; }
.plan .p-swing { fill: none; stroke: #B9C4CE; stroke-width: 1; stroke-dasharray: 2 3; }
.plan .p-window { stroke: #9CD3EC; stroke-width: 5; stroke-linecap: round; }
.plan .p-xrail { stroke: #5FAFD3; stroke-width: 1.8; fill: none; }
.plan .p-xrail.thin { stroke-width: 1; opacity: .8; }
.plan .p-divider { stroke: #E3DED4; stroke-width: 1.4; stroke-dasharray: 3 6; }
.plan .p-roomzone { fill: rgba(0, 166, 230, .04); stroke: #CFE3EE; stroke-width: 1; stroke-dasharray: 4 4; }
.plan .p-roof { stroke: #33465A; stroke-width: 4; }
.plan .p-glassedge { fill: #9CD3EC; }
.plan .p-shade { stroke: rgba(10, 37, 64, .25); stroke-width: 1.2; stroke-dasharray: 6 4; }
.plan .p-post { fill: #33465A; }
.plan .p-planter { fill: #D8CAB2; }
.plan .p-leaf { fill: #6A9F68; }
.plan .p-stairs rect { fill: #F1EEE8; stroke: #CFC8BC; }
.plan .p-stairs path { stroke: #CFC8BC; stroke-width: 1.2; }
.plan .p-core { fill: #F1F2F3; stroke: #DCDFE2; }
.plan .p-label { fill: var(--muted); font: 600 10.5px var(--font); }
.plan .p-label.lg { font-size: 15px; fill: #A9B3BC; }
.seat .tbl-in { fill: rgba(255, 255, 255, .45); pointer-events: none; }

/* الجلسة */
.seat { cursor: pointer; outline: none; }
.seat .tbl, .seat .room { stroke-width: 2; transition: fill .25s var(--ease), stroke .25s var(--ease); }
.seat .chair { stroke-width: 1.5; transition: fill .25s var(--ease), stroke .25s var(--ease); }
.seat .seat-t { font: 700 11px var(--font); pointer-events: none; }
.seat .halo { fill: var(--blue); opacity: 0; transition: opacity .3s var(--ease); }
.seat .star { fill: var(--gold); }

.seat.st-free .tbl { fill: var(--free-bg); stroke: var(--free); }
.seat.st-free .chair { fill: #fff; stroke: var(--free); }
.seat.st-free .seat-t { fill: var(--free); }
.seat.st-free.cat-prem .tbl { fill: var(--gold-bg); stroke: var(--gold); }
.seat.st-free.cat-prem .chair { stroke: var(--gold); }
.seat.st-free.cat-prem .seat-t { fill: var(--gold); }
.seat.st-free.cat-room .room { fill: var(--free-bg); stroke: var(--free); stroke-dasharray: 6 5; }
.seat.cat-room .room { fill: #fff; stroke: var(--line); }

.seat.st-busy .tbl { fill: var(--busy-bg); stroke: var(--busy); }
.seat.st-busy .chair { fill: #fff; stroke: var(--busy); }
.seat.st-busy .seat-t { fill: var(--busy); }
.seat.st-busy .room { fill: var(--busy-bg); stroke: var(--busy); }
.seat.st-busy { cursor: not-allowed; }

.seat.st-off .tbl, .seat.st-off .room { fill: var(--off-bg); stroke: var(--off); }
.seat.st-off .chair { fill: #fff; stroke: var(--off); }
.seat.st-off .seat-t { fill: var(--off); }
.seat.st-off .star { fill: var(--off); }
.seat.st-off { cursor: not-allowed; }

.seat:hover:not(.st-busy):not(.st-off) .halo, .seat:focus-visible .halo { opacity: .08; }
.seat.is-selected .halo { opacity: .14; animation: pulse 1.8s var(--ease) infinite; }
.seat.is-selected .tbl, .seat.is-selected .room { fill: var(--blue); stroke: var(--blue); }
.seat.is-selected .chair { fill: #fff; stroke: var(--blue); }
.seat.is-selected .seat-t { fill: #fff; }
@keyframes pulse { 50% { opacity: .04; } }

/* حالات التشغيل في لوحة المطعم */
.seat.st-arrived .tbl, .seat.st-arrived .room { fill: #FFF3D6; stroke: #C98A00; }
.seat.st-arrived .chair { fill: #fff; stroke: #C98A00; } .seat.st-arrived .seat-t { fill: #A06E00; }
.seat.st-seated .tbl, .seat.st-seated .room { fill: var(--navy); stroke: var(--navy); }
.seat.st-seated .chair { fill: #fff; stroke: var(--navy); } .seat.st-seated .seat-t { fill: #fff; }
.seat.st-blocked .tbl, .seat.st-blocked .room { fill: repeating-linear-gradient(45deg, #eee, #eee 4px, #fff 4px, #fff 8px); fill: #ECEEF0; stroke: #7C8791; stroke-dasharray: 3 3; }
.seat.st-blocked .chair { fill: #fff; stroke: #7C8791; } .seat.st-blocked .seat-t { fill: #7C8791; }
.seat.st-busy.op { cursor: pointer; }

/* «تقليل الحركة»: نوقف الحركة المستمرة فقط (أمواج المخطط ونبض الاختيار). المقدمة قرار صاحب المطعم، وتُعرض دائمًا مع زر تخطي */
@media (prefers-reduced-motion: reduce) {
  .plan .p-wave, .seat.is-selected .halo { animation: none; }
}
