/* ========================================
   AutoWash - Self-Service Kiosk Styles
   McDonald's-style touch terminal UI
   ======================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #06b6d4;
  --success: #22c55e;
  --info: #3b82f6;
  --error: #ef4444;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #0f172a;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-white: #ffffff;

  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

  --radius: 16px;
  --radius-lg: 24px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition: all 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  background: #111827;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Tablet Frame --- */
.tablet-frame {
  width: 820px;
  height: 1140px;
  background: #1c1c1e;
  border-radius: 40px;
  padding: 18px;
  box-shadow:
    0 0 0 2px #333,
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
}

.tablet-notch {
  display: flex;
  justify-content: center;
  padding: 6px 0 8px;
}

.tablet-camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2c2c2e;
  border: 1px solid #3a3a3c;
}

.tablet-screen {
  flex: 1;
  background: var(--bg);
  border-radius: 22px;
  overflow: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tablet-screen::-webkit-scrollbar { width: 0; }

/* --- Header --- */
.header {
  background: var(--bg-header);
  color: var(--text-white);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon {
  width: 28px;
  height: 28px;
  stroke: var(--text-white);
}

.header-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Main --- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 28px 20px;
}

/* --- Screens --- */
.screen {
  display: none;
  flex: 1;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Kiosk Heading --- */
.kiosk-heading {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: -0.03em;
}

/* ===========================================
   Service Cards - Big touch targets
   =========================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  flex: 1;
}

.service-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  user-select: none;
  -webkit-user-select: none;
}

.service-card:active {
  transform: scale(0.97);
}

.service-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-icon svg {
  width: 40px;
  height: 40px;
}

.service-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.service-tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.service-price {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.service-duration {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===========================================
   Payment Screen
   =========================================== */
.payment-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.payment-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
  text-align: center;
  width: 100%;
}

.payment-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-icon-wrap svg {
  width: 36px;
  height: 36px;
}

.payment-service-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.payment-price {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.payment-duration {
  font-size: 1rem;
  color: var(--text-muted);
}

.payment-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ===========================================
   Kiosk Buttons - Big and touch-friendly
   =========================================== */
.kiosk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 22px 32px;
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  min-height: 68px;
  user-select: none;
  -webkit-user-select: none;
}

.kiosk-btn:active { transform: scale(0.97); }

.kiosk-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.kiosk-btn-mp {
  background: #009ee3;
  color: var(--text-white);
}

.kiosk-btn-mp:hover { background: #0087c4; }

.kiosk-btn-simulate {
  background: var(--success);
  color: var(--text-white);
  animation: pulse-sim 2s ease-in-out infinite;
}

.kiosk-btn-simulate:hover { background: #16a34a; }

@keyframes pulse-sim {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
}

.kiosk-btn-primary {
  background: var(--primary);
  color: var(--text-white);
  margin-top: 12px;
}

.kiosk-btn-primary:hover { background: var(--primary-dark); }

.kiosk-btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  padding: 14px;
  margin: 0 auto;
  transition: var(--transition);
}

.kiosk-btn-back:hover { color: var(--text); }

.kiosk-btn-back svg {
  width: 20px;
  height: 20px;
}

/* ===========================================
   Washing Screen
   =========================================== */
.washing-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.washing-icon-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin-wash 2.5s linear infinite;
}

.washing-icon-wrap svg {
  width: 56px;
  height: 56px;
  stroke: var(--text-white);
}

@keyframes spin-wash {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.washing-icon-wrap.done {
  background: linear-gradient(135deg, var(--success), #16a34a);
  animation: none;
}

.washing-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
}

.timer-display {
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
}

.progress-bar-container {
  width: 100%;
  height: 14px;
  background: #e2e8f0;
  border-radius: 7px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 7px;
  transition: width 1s linear;
  width: 0%;
}

.progress-bar.done {
  background: var(--success);
  width: 100%;
}

.washing-meta {
  display: flex;
  gap: 20px;
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ===========================================
   Toasts
   =========================================== */
.toast-container {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
  font-size: 1rem;
  font-weight: 600;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  white-space: nowrap;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.info { border-left: 4px solid var(--info); }

.toast-icon { width: 22px; height: 22px; flex-shrink: 0; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-12px); }
}

/* ===========================================
   Modals
   =========================================== */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 420px;
  width: 88%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.92);
  transition: var(--transition);
  text-align: center;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.modal-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin-wash 1s linear infinite;
}

/* QR Modal */
.modal-qr { max-width: 380px; }

.qr-code-container {
  width: 200px;
  height: 200px;
  margin: 16px auto;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
}

.qr-code-container canvas { image-rendering: pixelated; }

.qr-price {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 20px;
}

/* ===========================================
   Demo Button - Outside tablet, for presentations
   =========================================== */
.demo-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 20px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2000;
}

.demo-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-height: 1200px) {
  .tablet-frame { height: 96vh; }
}

@media (max-width: 860px) {
  .tablet-frame {
    width: 96vw;
    height: 96vh;
    border-radius: 28px;
    padding: 12px;
  }

  .tablet-screen { border-radius: 18px; }

  .main { padding: 20px; }

  .kiosk-heading { font-size: 1.6rem; margin-bottom: 20px; }

  .service-icon { width: 64px; height: 64px; }
  .service-icon svg { width: 32px; height: 32px; }
  .service-name { font-size: 1.2rem; }
  .service-price { font-size: 1.8rem; }
}
