/* Smart Vending & Godown Material Dispenser Kiosk Stylesheet */
:root {
  --primary: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.4);
  --accent: #38bdf8;
  --bg-dark: #090d16;
  --card-bg: #111827;
  --card-border: #1f2937;
  --card-hover: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.08) 0%, transparent 40%);
}

/* Kiosk Top Bar */
.kiosk-header {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1f2937;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.kiosk-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kiosk-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--primary-glow);
}

.kiosk-title h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.kiosk-title span {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Badges */
.badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); opacity: 1; }
}

/* Language Switcher */
.lang-switch {
  display: flex;
  background: #1f2937;
  border-radius: 10px;
  padding: 3px;
  border: 1px solid #374151;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Screens Container */
.screen {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.screen.active {
  display: block;
}

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

/* Home / Lock Screen */
.lockscreen-wrapper {
  max-width: 520px;
  margin: 40px auto;
  padding: 30px;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid #1f2937;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(2, 132, 199, 0.1);
  text-align: center;
}

.lock-pin-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0 30px;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #374151;
  background: #1f2937;
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background: var(--accent);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  transform: scale(1.15);
}

/* Kiosk Numeric Keypad */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 340px;
  margin: 0 auto;
}

.numpad-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 16px;
  padding: 16px 0;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.numpad-btn:hover {
  background: #334155;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.numpad-btn:active {
  transform: translateY(2px);
  background: var(--primary);
}

.numpad-btn.action {
  font-size: 1rem;
  font-weight: 600;
}

.numpad-btn.clear {
  color: #f87171;
}

.numpad-btn.submit {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  border: none;
}

/* Voice Button Big */
.voice-action-btn {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 1px solid #4338ca;
  color: #c7d2fe;
  padding: 14px 20px;
  border-radius: 14px;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.voice-action-btn:hover {
  background: linear-gradient(135deg, #312e81, #3730a3);
  color: #fff;
  border-color: #6366f1;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.voice-action-btn.listening {
  background: #dc2626;
  border-color: #ef4444;
  color: #fff;
  animation: pulse-red 1s infinite alternate;
}

@keyframes pulse-red {
  from { box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
  to { box-shadow: 0 0 24px rgba(239, 68, 68, 0.9); }
}

/* Audio Wave Visualizer */
.audio-visualizer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  height: 28px;
  margin: 10px 0;
}

.wave-bar {
  width: 4px;
  height: 6px;
  background: #818cf8;
  border-radius: 4px;
  transition: height 0.1s ease;
}

.listening .wave-bar {
  animation: soundWave 0.6s infinite ease-in-out alternate;
}

.wave-bar:nth-child(1) { animation-delay: 0.1s; }
.wave-bar:nth-child(2) { animation-delay: 0.3s; }
.wave-bar:nth-child(3) { animation-delay: 0.15s; }
.wave-bar:nth-child(4) { animation-delay: 0.4s; }
.wave-bar:nth-child(5) { animation-delay: 0.25s; }

@keyframes soundWave {
  0% { height: 6px; }
  100% { height: 26px; }
}

/* Catalog Screen */
.catalog-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.catalog-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111827;
  padding: 16px 24px;
  border-radius: 16px;
  border: 1px solid #1f2937;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #38bdf8;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(2, 132, 199, 0.15);
}

.card-img-wrapper {
  height: 200px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid #1f2937;
  overflow: hidden;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Location Tag on Card */
.location-badge {
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid #0284c7;
  color: #38bdf8;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
}

.location-badge.highlight-godown1 {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #34d399;
}

/* Stock Indicator */
.stock-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stock-badge.low-stock {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  animation: pulse-red 1.5s infinite alternate;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title-en {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.card-title-te {
  font-size: 0.98rem;
  color: #38bdf8;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 8px 0 12px;
  line-height: 1.4;
  flex: 1;
}

/* Listen Button on Product */
.card-audio-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.btn-audio-listen {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-audio-listen:hover {
  background: #0284c7;
  color: white;
  border-color: #38bdf8;
}

.btn-audio-listen.speaking {
  background: #10b981;
  color: white;
  border-color: #34d399;
}

/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #1f2937;
}

.qty-counter {
  display: flex;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  color: #fff;
  width: 36px;
  height: 38px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: #334155;
}

.qty-input {
  width: 44px;
  background: transparent;
  border: none;
  color: #fff;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
}

.btn-take-dispense {
  flex: 1;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-take-dispense:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-2px);
}

.btn-take-dispense:disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Floating Dispense Cart Tray */
.floating-cart-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid #38bdf8;
  border-radius: 20px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(2, 132, 199, 0.3);
  z-index: 40;
  max-width: 720px;
  width: 90%;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translate(-50%, 40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Modal Windows */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  padding: 28px;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(2, 132, 199, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

/* Vending Machine Dispense Animation */
.vending-box-sim {
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 16px;
  height: 220px;
  position: relative;
  overflow: hidden;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vending-shelf {
  height: 120px;
  border-bottom: 3px solid #475569;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(90deg, #1e293b, #1e293b 20px, #182234 20px, #182234 40px);
}

.vending-coil {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 4px dashed #94a3b8;
  border-radius: 50%;
  top: 15px;
}

.vending-coil.rotating {
  animation: rotateCoil 2s infinite linear;
}

@keyframes rotateCoil {
  from { transform: rotate(0deg); }
  to { transform: rotate(720deg); }
}

.vending-item-drop {
  width: 70px;
  height: 70px;
  z-index: 10;
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.vending-item-drop.dropping {
  transform: translateY(110px) scale(0.9);
}

.vending-tray-bin {
  height: 60px;
  background: #020617;
  border-top: 2px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  gap: 8px;
}

/* Admin Tabs & UI */
.admin-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid #1f2937;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.admin-tab-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tab-btn.active {
  background: var(--primary);
  border-color: #38bdf8;
  color: white;
}

/* Alerts Banner */
.alert-strip {
  background: linear-gradient(90deg, #7f1d1d, #991b1b);
  border: 1px solid #ef4444;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* Table styling for Admin Inventory & Logs */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  background: #111827;
  border-radius: 12px;
  overflow: hidden;
}

.styled-table th, .styled-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #1f2937;
  font-size: 0.88rem;
}

.styled-table th {
  background: #1e293b;
  color: #cbd5e1;
  font-weight: 700;
}

.styled-table tr:hover {
  background: #182234;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  .catalog-header-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
