/* Ensure hidden attribute works even with flex/grid classes */
[hidden] { display: none !important; }

/* DaisyUI v4 custom themes — oklch values without wrapper */
/* DaisyUI v4 uses: oklch(var(--p)) internally */

[data-theme="dark"] {
  color-scheme: dark;
  --b1: 30.33% 0.016 252.42;
  --b2: 25.26% 0.014 253.1;
  --b3: 20.15% 0.012 254.09;
  --bc: 97.807% 0.029 256.847;
  --p: 58% 0.233 277.117;
  --pc: 96% 0.018 272.314;
  --s: 58% 0.233 277.117;
  --sc: 96% 0.018 272.314;
  --a: 60% 0.25 292.717;
  --ac: 96% 0.016 293.756;
  --n: 37% 0.044 257.287;
  --nc: 98% 0.003 247.858;
  --in: 58% 0.158 241.966;
  --inc: 97% 0.013 236.62;
  --su: 60% 0.118 184.704;
  --suc: 98% 0.014 180.72;
  --wa: 66% 0.179 58.318;
  --wac: 98% 0.022 95.277;
  --er: 58% 0.253 17.585;
  --erc: 96% 0.015 12.422;
  --rounded-box: 0.5rem;
  --rounded-btn: 0.25rem;
  --rounded-badge: 1.9rem;
  --btn-text-case: none;
  --border-btn: 1.5px;
  --tab-border: 1.5px;
  --animation-btn: 0.25s;
  --animation-input: 0.2s;
}

[data-theme="light"] {
  color-scheme: light;
  --b1: 98% 0 0;
  --b2: 96% 0.001 286.375;
  --b3: 92% 0.004 286.32;
  --bc: 21% 0.006 285.885;
  --p: 70% 0.213 47.604;
  --pc: 98% 0.016 73.684;
  --s: 55% 0.027 264.364;
  --sc: 98% 0.002 247.839;
  --a: 0% 0 0;
  --ac: 100% 0 0;
  --n: 44% 0.017 285.786;
  --nc: 98% 0 0;
  --in: 62% 0.214 259.815;
  --inc: 97% 0.014 254.604;
  --su: 70% 0.14 182.503;
  --suc: 98% 0.014 180.72;
  --wa: 66% 0.179 58.318;
  --wac: 98% 0.022 95.277;
  --er: 58% 0.253 17.585;
  --erc: 96% 0.015 12.422;
  --rounded-box: 0.5rem;
  --rounded-btn: 0.25rem;
  --rounded-badge: 1.9rem;
  --btn-text-case: none;
  --border-btn: 1.5px;
  --tab-border: 1.5px;
  --animation-btn: 0.25s;
  --animation-input: 0.2s;
}

/* Base fallbacks for browsers without oklch() */
@supports not (color: oklch(50% 0 0)) {
  html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    color: #111111;
    line-height: 1.5;
  }

  body {
    margin: 0 auto;
    padding: 1rem;
    max-width: 42rem;
  }

  h1, h2, h3 { font-weight: 700; }
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  a { color: #1d4ed8; }

  input[type="text"], input:not([type]) {
    font: inherit;
    padding: 0.4rem 0.6rem;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    color: inherit;
  }

  button, .btn {
    font: inherit;
    padding: 0.5rem 1rem;
    border: 1px solid #1d4ed8;
    border-radius: 4px;
    background: #1d4ed8;
    color: #fff;
    cursor: pointer;
  }

  pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #f3f4f6;
    padding: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }
}

/* Receiver ID input */
input.input-receiver-id {
  width: 7em;
  text-transform: uppercase;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.15em;
  padding: 0.4em 0.5em;
}

.input-with-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.1em;
}

.input-with-clear input {
  margin-bottom: 0;
}

button.clear-button {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  width: 1.75em;
  height: 1.75em;
  font-size: 1.5em;
  line-height: 1;
  opacity: 0.5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.clear-button:hover {
  opacity: 1;
}

/* QR code */
.qr-code {
  max-width: 300px;
  margin: 0 auto 1rem;
  text-align: center;
}

.qr-code svg {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .qr-code {
    float: right;
    margin-left: 1rem;
  }
}

/* Button styling to match production (DaisyUI v5) */
.btn {
  padding-left: 1rem;
  padding-right: 1rem;
  height: 2.1875rem;
  min-height: 2.1875rem;
  box-shadow:
    rgba(255 255 255 / 0.06) 0px 0.5px 0px 0.5px inset,
    rgba(0 0 0 / 0.15) 0px 3px 2px -2px,
    rgba(0 0 0 / 0.15) 0px 4px 3px -2px;
}

/* Disabled button */
.btn.btn-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Fullscreen slideshow overlay */
.slideshow-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.slideshow-fullscreen-img {
  max-width: 100%;
  max-height: calc(100vh - 4rem);
  max-height: calc(100dvh - 4rem);
  object-fit: contain;
  cursor: default;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.slideshow-fullscreen-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  cursor: default;
}

.slideshow-fullscreen-bar * {
  pointer-events: auto;
}

/* Flash toast notifications */
.flash-toast {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  animation: flash-in 0.2s ease-out;
  max-width: 20rem;
}

.flash-toast.flash-info {
  background: oklch(58% 0.158 241.966);
  color: oklch(97% 0.013 236.62);
}

.flash-toast.flash-error {
  background: oklch(58% 0.253 17.585);
  color: oklch(96% 0.015 12.422);
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}
