/* ==========================================================================
   Raised ("3D") buttons — Cloudflare-dashboard style
   --------------------------------------------------------------------------
   Load LAST (after admin.css / tailadmin-theme.css / pos.css).
   Look: soft top-to-bottom gradient, 1px darker border, white inner highlight
   on the top edge, faint dark inner line on the bottom edge, small drop shadow.
   Pressed: the button sinks 1px and the shadow flips inward.

   Colours are derived from ONE variable per button (--rb) with color-mix(),
   so the effect follows the EliteDuka brand token (--primary) and the POS
   per-store accent (--pos-accent) automatically. Nothing here hard-codes a
   brand colour. Layout, sizes and radius are NOT touched — colour/shadow only.
   ========================================================================== */

:root {
  --rb-hi:   inset 0 1px 0 rgba(255, 255, 255, 0.28);   /* top-edge highlight */
  --rb-lo:   inset 0 -1px 0 rgba(0, 0, 0, 0.14);        /* bottom-edge shade  */
  --rb-drop: 0 1px 2px rgba(16, 24, 40, 0.22);          /* lift off the page  */
  --rb-sink: inset 0 2px 4px rgba(0, 0, 0, 0.26);       /* pressed            */
}

/* ---- Solid buttons: primary, premium, POS charge / scan -------------------- */
.btn.btn-primary,
.btn.btn-gold,
.pos-charge-btn,
.pos-scan-btn {
  box-shadow: var(--rb-hi), var(--rb-lo), var(--rb-drop);
}
.btn.btn-primary { --rb: var(--primary); --rb-h: var(--primary-dark); }
.btn.btn-gold    { --rb: var(--gold);    --rb-h: var(--gold-dark); }
.pos-charge-btn  { --rb: var(--pos-accent); --rb-h: var(--pos-accent); }
.pos-scan-btn    { --rb: var(--pos-card-dark); --rb-h: var(--primary-dark); }

@supports (background: color-mix(in srgb, red 50%, blue)) {
  .btn.btn-primary,
  .btn.btn-gold,
  .pos-charge-btn,
  .pos-scan-btn {
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--rb) 84%, #fff) 0%,
      var(--rb) 100%);
    border-color: color-mix(in srgb, var(--rb) 78%, #000);
  }
  .btn.btn-primary:hover:not(:disabled),
  .btn.btn-gold:hover:not(:disabled),
  .pos-charge-btn:hover:not(:disabled),
  .pos-scan-btn:hover:not(:disabled) {
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--rb-h) 84%, #fff) 0%,
      var(--rb-h) 100%);
    border-color: color-mix(in srgb, var(--rb-h) 78%, #000);
    filter: none;
  }
}
/* POS buttons had no border; give them the 1px edge the effect needs. */
.pos-charge-btn, .pos-scan-btn { border: 1px solid transparent; }
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .pos-charge-btn, .pos-scan-btn { border-color: color-mix(in srgb, var(--rb) 78%, #000); }
}

/* Pressed */
.btn.btn-primary:active:not(:disabled),
.btn.btn-gold:active:not(:disabled),
.pos-charge-btn:active:not(:disabled),
.pos-scan-btn:active {
  
  box-shadow: var(--rb-sink);
}

/* ---- Outline buttons: ghost, danger-outline -------------------------------- */
.btn.btn-ghost,
.btn.btn-danger-outline {
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(16, 24, 40, 0.10);
}
.btn.btn-ghost:hover:not(:disabled) {
  background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
}
.btn.btn-danger-outline:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--color-danger-soft) 0%, #fee4e2 100%);
}
.btn.btn-ghost:active:not(:disabled),
.btn.btn-danger-outline:active:not(:disabled) {
  
  box-shadow: inset 0 2px 3px rgba(16, 24, 40, 0.14);
}

/* ---- Disabled: flat, no lift ------------------------------------------------ */
.btn.btn-primary:disabled, .btn.btn-gold:disabled,
.btn.btn-ghost:disabled,   .btn.btn-danger-outline:disabled,
.pos-charge-btn:disabled,  .pos-scan-btn:disabled {
  box-shadow: none;
  transform: none;
}
.pos-charge-btn:disabled { border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .btn.btn-primary:active, .btn.btn-gold:active, .btn.btn-ghost:active,
  .btn.btn-danger-outline:active, .pos-charge-btn:active, .pos-scan-btn:active { transform: none; }
}

/* ==========================================================================
   Sidebar buttons (SIDEBAR-COLLAPSE-1) — same recipe as above, tuned for the dark-blue shell.
   Edge is drawn with an inset 1px ring (box-shadow), NOT a border, so the 42px collapsed
   square and icon alignment never change. Active = raised pale-blue pill (#E3F4EB).
   ========================================================================== */
.sidebar .nav-link {
  margin-bottom: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.10),
              inset 0 -1px 0 rgba(0, 0, 0, 0.16), 0 1px 2px rgba(0, 0, 0, 0.28);
}
.sidebar .nav-link:hover,
.sidebar .nav-link:hover:not(.active) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%);
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .sidebar .nav-link:hover:not(.active) {
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 84%, #fff) 0%, var(--primary) 100%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 78%, #000), inset 0 1px 0 rgba(255, 255, 255, 0.28),
                inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.30);
  }
}
.sidebar .nav-link.active,
.sidebar .nav-link.active:hover {
  background: linear-gradient(180deg, #ffffff 0%, var(--shell-sidebar-active-bg) 100%);
  box-shadow: inset 0 0 0 1px #BFE3CE, inset 0 1px 0 #ffffff,
              inset 0 -1px 0 rgba(22,138,78, 0.14), 0 2px 4px rgba(0, 0, 0, 0.30);
}
.sidebar .nav-link:active {
  
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.30);
}
.sidebar .nav-link.active:active { box-shadow: inset 0 2px 3px rgba(22,138,78, 0.22); }

/* Collapse toggle: raised ghost button */
.sidebar-collapse-toggle {
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 3px rgba(16, 24, 40, 0.25);
}
.sidebar-collapse-toggle:hover { background: linear-gradient(180deg, #ffffff 0%, var(--color-primary-soft) 100%); }
.sidebar-collapse-toggle:active { box-shadow: inset 0 2px 3px rgba(16, 24, 40, 0.20); }

@media (prefers-reduced-motion: reduce) {
  .sidebar .nav-link:active, .sidebar-collapse-toggle:active { transform: none; }
}
