/* Self-hosted Poppins (latin subset), plus what utility classes can't cover:
   scrollbar, selection, and the table/form components shared by admin pages. */

/* Theme tokens as RGB triplets so Tailwind opacity modifiers keep working.
   Admin pages never set data-theme, so they always get the :root defaults. */

:root {                              /* Dark Roast */
  --c-espresso: 22 16 11;
  --c-roast: 36 26 18;
  --c-bean: 58 42 26;
  --c-crema: 237 228 211;
  --c-foam: 156 139 116;
  --c-caramel: 196 155 99;
  --c-shadow: 8 5 2;
}

html[data-theme="strawberry-latte"] {
  --c-espresso: 43 26 31;
  --c-roast: 58 34 41;
  --c-bean: 82 48 58;
  --c-crema: 245 230 234;
  --c-foam: 196 154 166;
  --c-caramel: 232 116 154;
  --c-shadow: 18 8 11;
}

html[data-theme="morning-brew"] {
  --c-espresso: 245 238 222;
  --c-roast: 255 255 255;
  --c-bean: 217 201 173;
  --c-crema: 43 29 16;
  --c-foam: 113 98 76;
  --c-caramel: 143 90 31;
  --c-shadow: 92 74 48;
}

html[data-theme="matcha"] {
  --c-espresso: 20 32 26;
  --c-roast: 30 47 37;
  --c-bean: 50 73 60;
  --c-crema: 233 240 228;
  --c-foam: 147 168 148;
  --c-caramel: 158 201 127;
  --c-shadow: 5 10 7;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/poppins-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/poppins-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/poppins-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/poppins-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/poppins-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/fraunces.woff2') format('woff2');
}

.font-serif {
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 0;
  letter-spacing: -0.02em;
}

:focus-visible {
  outline: 2px solid rgb(var(--c-caramel));
  outline-offset: 2px;
  border-radius: 4px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: rgb(var(--c-caramel));
}

h1,
h2,
h3 {
  text-wrap: balance;
}

button,
a,
select,
input[type="checkbox"] {
  transition-property: color, background-color, border-color, transform, opacity;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(var(--c-foam));
  animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }

  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgb(var(--c-espresso));
}

::-webkit-scrollbar-thumb {
  background: rgb(var(--c-bean));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--c-caramel));
}

::selection {
  background: rgb(var(--c-caramel));
  color: rgb(var(--c-espresso));
}

/* Shared admin components (Tailwind CDN has no @apply, and these repeat
   across 20 admin pages). */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: rgb(var(--c-roast));
  border: 1px solid rgb(var(--c-bean));
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.875rem;
}

.admin-table th {
  background: rgb(var(--c-espresso));
  color: rgb(var(--c-caramel));
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
}

.admin-table td {
  padding: 10px 12px;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--c-crema));
  border-top: 1px solid rgb(var(--c-bean));
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgb(var(--c-crema) / 0.04);
}

.admin-form {
  background: rgb(var(--c-roast));
  border: 1px solid rgb(var(--c-bean));
  border-radius: 12px;
  padding: 24px;
  max-width: 560px;
  margin: 0 auto;
}

.admin-form label {
  display: block;
  color: rgb(var(--c-foam));
  font-size: 0.875rem;
  margin: 14px 0 6px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgb(var(--c-espresso));
  color: rgb(var(--c-crema));
  border: 1px solid rgb(var(--c-bean));
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: 2px solid rgb(var(--c-caramel));
  outline-offset: 0;
  border-color: rgb(var(--c-caramel));
}

.btn-caramel {
  display: inline-block;
  background: rgb(var(--c-caramel));
  color: rgb(var(--c-espresso));
  font-weight: 600;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-caramel:hover {
  background: rgb(var(--c-crema));
}

.btn-outline {
  display: inline-block;
  background: transparent;
  color: rgb(var(--c-caramel));
  border: 1px solid rgb(var(--c-caramel));
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-outline:hover {
  background: rgb(var(--c-caramel));
  color: rgb(var(--c-espresso));
}

.btn-danger {
  display: inline-block;
  background: transparent;
  color: #d9776b;
  border: 1px solid #d9776b;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-danger:hover {
  background: #d9776b;
  color: rgb(var(--c-espresso));
}

/* Order status badges: fixed semantic hues, darkened for the light theme. */

.badge-danger  { background: rgb(248 113 113 / 0.16); color: #fca5a5; }
.badge-warning { background: rgb(250 204 21 / 0.16);  color: #fde047; }
.badge-info    { background: rgb(96 165 250 / 0.16);  color: #93c5fd; }
.badge-success { background: rgb(74 222 128 / 0.16);  color: #86efac; }
.badge-accent  { background: rgb(var(--c-caramel) / 0.18); color: rgb(var(--c-caramel)); }

html[data-theme="morning-brew"] .badge-danger  { color: #b91c1c; }
html[data-theme="morning-brew"] .badge-warning { background: rgb(202 138 4 / 0.14); color: #854d0e; }
html[data-theme="morning-brew"] .badge-info    { color: #1d4ed8; }
html[data-theme="morning-brew"] .badge-success { color: #15803d; }

.flash-message {
  text-align: center;
  color: rgb(var(--c-caramel));
  font-weight: 600;
  margin: 16px auto;
}
