/* =========================================================================
   PERMANENT GLOBAL DUBAI CLOCK  ·  reusable component  (.dxc / DubaiClock)
   Live Asia/Dubai (GST · UTC+4) time — mounts into every page header.
   Premium fintech glassmorphism · GPU-only (transform/opacity) animations.
   Light + dark aware · mobile responsive · respects reduced-motion.
   ========================================================================= */
:root{
  --dxc-green:#3B6E46;
  --dxc-green-2:#4F8A5A;
  --dxc-green-deep:#274631;
  --dxc-green-bright:#6BA46F;
}

/* ---------- shell (the pill) ---------- */
.dxc{
  --dxc-fill:0;                               /* 0..1 seconds progress (JS) */
  position:relative;
  display:inline-flex;align-items:center;gap:11px;
  padding:7px 13px 7px 8px;
  border-radius:999px;
  font-family:var(--mono,"Roboto Mono","SF Mono",monospace);
  line-height:1;white-space:nowrap;
  color:var(--dxc-green-deep);
  background:linear-gradient(135deg,rgba(255,255,255,.86),rgba(232,245,233,.62));
  border:1px solid rgba(43,58,38,.16);
  box-shadow:0 1px 0 rgba(255,255,255,.75) inset,0 6px 18px rgba(24,30,22,.12);
  -webkit-backdrop-filter:blur(13px) saturate(170%);
  backdrop-filter:blur(13px) saturate(170%);
  cursor:default;user-select:none;
  transition:transform .45s cubic-bezier(.2,.8,.2,1),border-color .45s,box-shadow .45s;
  animation:dxcIn .75s cubic-bezier(.2,.85,.2,1) both;
}
.dxc:hover{
  transform:translateY(-1px);
  border-color:rgba(122,131,143,.45);
  box-shadow:0 1px 0 rgba(255,255,255,.85) inset,0 12px 28px rgba(24,30,22,.18),0 0 30px rgba(122,131,143,.3);
}

/* breathing halo behind the pill */
.dxc::before{
  content:"";position:absolute;inset:-5px;border-radius:inherit;z-index:-1;pointer-events:none;
  background:radial-gradient(135% 150% at 18% 50%,rgba(122,131,143,.5),rgba(122,131,143,0) 62%);
  filter:blur(9px);opacity:.55;
  animation:dxcHalo 4.6s ease-in-out 1.1s infinite;
}

/* glass sheen sweep */
.dxc-sheen{position:absolute;inset:0;border-radius:inherit;overflow:hidden;z-index:1;pointer-events:none}
.dxc-sheen::before{
  content:"";position:absolute;top:-40%;left:-65%;width:42%;height:180%;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.6),transparent);
  transform:skewX(-18deg);
  animation:dxcSheen 8s ease-in-out 2.2s infinite;
}

/* ---------- dial : progress ring + mini analog clock ---------- */
.dxc-dial{position:relative;width:34px;height:34px;flex:0 0 auto;display:grid;place-items:center;z-index:2}
.dxc-ring{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg);overflow:visible}
.dxc-ring-bg{fill:none;stroke:rgba(43,58,38,.16);stroke-width:3}
.dxc-ring-fg{
  fill:none;stroke:var(--dxc-green-bright);stroke-width:3;stroke-linecap:round;
  stroke-dasharray:113.097;
  stroke-dashoffset:calc(113.097 * (1 - var(--dxc-fill)));
  filter:drop-shadow(0 0 3px rgba(122,131,143,.65));
  transition:stroke-dashoffset .85s linear;
}
.dxc.dxc-wrap .dxc-ring-fg{transition:none}

.dxc-face{
  position:relative;width:21px;height:21px;border-radius:50%;
  background:radial-gradient(circle at 50% 36%,#ffffff,#e9f4e7);
  border:1.5px solid rgba(43,58,38,.3);
  box-shadow:0 1px 3px rgba(24,30,22,.16) inset;
}
.dxc-hand{
  position:absolute;left:50%;bottom:50%;transform-origin:50% 100%;
  border-radius:2px;background:var(--dxc-green-deep);
  transform:translateX(-50%) rotate(0deg);
  transition:transform .25s cubic-bezier(.3,1.5,.5,1);
}
.dxc-hand-h{width:2px;height:5px;opacity:.92}
.dxc-hand-m{width:1.6px;height:7px;opacity:.82}
.dxc-hand-s{width:1px;height:8px;background:var(--dxc-green-bright);box-shadow:0 0 4px rgba(122,131,143,.7)}
.dxc.dxc-wrap .dxc-hand-s{transition:none}
.dxc-pin{position:absolute;left:50%;top:50%;width:3px;height:3px;border-radius:50%;
  background:var(--dxc-green-deep);transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px rgba(255,255,255,.9)}

/* ---------- info : tag · time · date ---------- */
.dxc-info{display:flex;flex-direction:column;gap:2px;z-index:2}
.dxc-tag{display:inline-flex;align-items:center;gap:5px;font-size:9px;font-weight:700;
  letter-spacing:.13em;text-transform:uppercase;color:rgba(43,58,38,.72);
  font-family:var(--display,"Roboto",system-ui,sans-serif)}
.dxc-flag{font-size:11px;line-height:1}
.dxc-time{display:inline-flex;align-items:baseline;gap:1px;font-size:16px;font-weight:600;
  letter-spacing:.02em;font-variant-numeric:tabular-nums;color:var(--dxc-green-deep)}
.dxc-time b{font-weight:600}
.dxc-sep{opacity:.55;font-weight:500;margin:0 .5px}
.dxc-ss{color:var(--dxc-green-2);opacity:.6}
.dxc-ss.dxc-tick{animation:dxcTick .5s ease both}
.dxc-ap{margin-left:5px;font-size:9.5px;font-weight:700;letter-spacing:.06em;
  color:rgba(43,58,38,.6);align-self:center;font-family:var(--display,"Roboto",sans-serif)}
.dxc-date{font-size:9px;font-weight:600;letter-spacing:.04em;color:rgba(43,58,38,.58);
  font-family:var(--display,"Roboto",sans-serif);display:none}

/* ---------- LIVE pip ---------- */
.dxc-live{display:inline-flex;align-items:center;gap:5px;margin-left:3px;
  padding:3px 8px 3px 7px;border-radius:999px;z-index:2;
  background:linear-gradient(135deg,rgba(122,131,143,.16),rgba(43,58,38,.1));
  border:1px solid rgba(122,131,143,.32);
  font-family:var(--display,"Roboto",sans-serif);font-size:8.5px;font-weight:800;
  letter-spacing:.14em;color:var(--dxc-green)}
.dxc-pulse{position:relative;width:6px;height:6px;border-radius:50%;
  background:var(--dxc-green-bright);box-shadow:0 0 7px rgba(122,131,143,.9)}
.dxc-pulse::before{content:"";position:absolute;inset:0;border-radius:50%;
  background:var(--dxc-green-bright);animation:dxcPing 1.8s cubic-bezier(0,0,.2,1) infinite}

/* ---------- placement variants ---------- */
.dxc.dxc-in-nav{margin-right:4px}
.dxc.dxc-fixed{position:fixed;z-index:80;
  top:calc(14px + env(safe-area-inset-top,0px));
  right:calc(16px + env(safe-area-inset-right,0px))}

/* show the date on wide screens only (keeps the pill compact elsewhere) */
@media (min-width:1180px){ .dxc-date{display:block} }

/* =========================================================================
   keyframes — transform / opacity / filter only
   ========================================================================= */
@keyframes dxcIn{from{opacity:0;transform:translateY(-9px) scale(.9)}to{opacity:1;transform:none}}
@keyframes dxcHalo{0%,100%{opacity:.38;transform:scale(.97)}50%{opacity:.78;transform:scale(1.05)}}
@keyframes dxcSheen{0%{left:-65%}9%{left:140%}100%{left:140%}}
@keyframes dxcPing{0%{transform:scale(1);opacity:.85}80%,100%{transform:scale(3.4);opacity:0}}
@keyframes dxcTick{0%{opacity:.15;transform:translateY(-2px)}100%{opacity:.6;transform:none}}

/* =========================================================================
   responsive — compact pill on phones  ( 🇦🇪 Dubai 08:45 PM )
   ========================================================================= */
@media (max-width:640px){
  .dxc{gap:8px;padding:5px 11px 5px 6px}
  .dxc-dial{width:28px;height:28px}
  .dxc-face{width:17px;height:17px}
  .dxc-info{flex-direction:row;align-items:center;gap:6px}
  .dxc-tag{font-size:11px;letter-spacing:0;text-transform:none;font-weight:600;color:var(--dxc-green-deep)}
  .dxc-gst{display:none}
  .dxc-time{font-size:14px}
  .dxc-ss,.dxc-sep-s{display:none}
  .dxc-date{display:none}
  .dxc-livetxt{display:none}
  .dxc-live{padding:5px;gap:0}
}
@media (max-width:400px){
  .dxc-ap{display:none}
  .dxc-live{display:none}
  .dxc.dxc-in-nav{gap:6px}
}
@media (max-width:360px){
  .dxc-city{display:none}                 /* tiny phones: flag stands in for "Dubai" */
  .dxc.dxc-in-nav{padding:5px 9px 5px 5px}
}

/* =========================================================================
   MOBILE WIDE BANNER  ·  Dubai clock in dashboard/admin topbar
   On phones, the clock becomes a full-width premium banner that sits below
   the title and above the wallet/status chips. To make that work we also
   make the topbar wrap, and force .right to its own full-width row so the
   clock inside it can truly stretch across the screen.
   ========================================================================= */
@media (max-width:640px){
  .topbar{flex-wrap:wrap !important;align-items:center;gap:10px;padding:14px 16px}
  .topbar .right{flex:1 0 100%;width:100%;flex-direction:row;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between}
  .dxc.dxc-in-bar{
    order:-1;                     /* first item inside .right — sits above wallet/badge */
    flex:1 0 100%;                /* take the full topbar width */
    width:100%;
    margin:0;
    padding:10px 14px 10px 9px;
    border-radius:14px;
    justify-content:flex-start;
    gap:12px;
    box-shadow:0 1px 0 rgba(255,255,255,.75) inset,0 8px 22px rgba(24,30,22,.14);
  }
  .dxc.dxc-in-bar::before{filter:blur(11px);inset:-7px}
  .dxc.dxc-in-bar .dxc-dial{width:32px;height:32px}
  .dxc.dxc-in-bar .dxc-face{width:20px;height:20px}
  /* Two-line layout inside the wide banner.
     Row 1: 🇦🇪 UAE · GST          08:45:22 PM        ● LIVE
     Row 2:                Saturday, 06 June 2026     (right-aligned, subtle) */
  .dxc.dxc-in-bar .dxc-info{flex:1;flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:10px;row-gap:1px;min-width:0}
  .dxc.dxc-in-bar .dxc-tag{font-size:12px;letter-spacing:.02em;font-weight:700;color:var(--dxc-green-deep)}
  .dxc.dxc-in-bar .dxc-gst{display:inline;opacity:.65}
  .dxc.dxc-in-bar .dxc-city{display:inline}
  .dxc.dxc-in-bar .dxc-time{font-size:17px;margin-left:auto;letter-spacing:.02em}
  .dxc.dxc-in-bar .dxc-ss,.dxc.dxc-in-bar .dxc-sep-s{display:inline}    /* seconds on */
  .dxc.dxc-in-bar .dxc-ap{display:inline}
  .dxc.dxc-in-bar .dxc-live{display:inline-flex;margin-left:4px;padding:3px 8px 3px 7px;gap:5px}
  .dxc.dxc-in-bar .dxc-livetxt{display:inline}
  /* date — second line under the time, right-aligned, premium-quiet */
  .dxc.dxc-in-bar .dxc-date{
    display:block;
    flex:1 0 100%;
    text-align:right;
    margin-top:0;
    font-size:10.5px;
    font-weight:500;
    letter-spacing:.02em;
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
}
/* smaller phones — keep banner full-width but trim non-essentials */
@media (max-width:420px){
  .dxc.dxc-in-bar{padding:9px 12px 9px 8px;gap:10px}
  .dxc.dxc-in-bar .dxc-ss,.dxc.dxc-in-bar .dxc-sep-s{display:none}
  .dxc.dxc-in-bar .dxc-livetxt{display:none}
  .dxc.dxc-in-bar .dxc-live{padding:5px;gap:0}
  .dxc.dxc-in-bar .dxc-time{font-size:16px}
  .dxc.dxc-in-bar .dxc-tag{font-size:11.5px}
  .dxc.dxc-in-bar .dxc-gst{display:none}
  .dxc.dxc-in-bar .dxc-date{font-size:10px}
}
@media (max-width:360px){
  .dxc.dxc-in-bar .dxc-dial{width:28px;height:28px}
  .dxc.dxc-in-bar .dxc-face{width:17px;height:17px}
  .dxc.dxc-in-bar .dxc-time{font-size:15px}
}

/* =========================================================================
   dark-mode aware (OS preference)
   ========================================================================= */
@media (prefers-color-scheme:dark){
  .dxc{
    color:#e7f7ec;
    background:linear-gradient(135deg,rgba(18,30,21,.72),rgba(22,42,27,.6));
    border-color:rgba(168,176,187,.24);
    box-shadow:0 1px 0 rgba(255,255,255,.08) inset,0 8px 22px rgba(0,0,0,.4);
  }
  .dxc-time,.dxc-time b{color:#eafaef}
  .dxc-tag{color:rgba(210,215,222,.8)}
  .dxc-ap,.dxc-date{color:rgba(210,215,222,.62)}
  .dxc-ss{color:var(--dxc-green-bright);opacity:.85}
  .dxc-ring-bg{stroke:rgba(168,176,187,.2)}
  .dxc-face{background:radial-gradient(circle at 50% 36%,#173b22,#0d2415);border-color:rgba(168,176,187,.42)}
  .dxc-hand,.dxc-pin{background:#c4ecce}
  .dxc-hand-s{background:var(--dxc-green-bright)}
}

/* =========================================================================
   accessibility — calm everything for reduced-motion users
   ========================================================================= */
@media (prefers-reduced-motion:reduce){
  .dxc,.dxc::before,.dxc-sheen::before,.dxc-pulse::before,
  .dxc-sep,.dxc-ss.dxc-tick,.dxc-ring-fg,.dxc-hand{
    animation:none!important;transition:none!important;
  }
  .dxc::before{opacity:.5}
}
