/* =========================================================================
   Voice-Based Playing Card Recognition & Customer Management System
   Unified Modern SaaS Dark Theme Stylesheet
   ========================================================================= */

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --border-color: rgba(51, 65, 85, 0.6);
  --border-focus: rgba(99, 102, 241, 0.8);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --suit-red: #dc2626;
  --suit-black: #0f172a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.glass-panel-subtle {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 12px;
}

/* Playing Card Component */
.playing-card {
  width: 105px;
  height: 150px;
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border-radius: 12px;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  position: relative;
  animation: popIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.playing-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 16px 30px -6px rgba(99, 102, 241, 0.4);
}

.playing-card.card-missing {
  background: linear-gradient(145deg, #261b1b, #181111);
  border: 1px dashed #ef4444;
  color: #f87171;
  box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.2);
}

.suit-red { color: var(--suit-red); }
.suit-black { color: var(--suit-black); }
.suit-missing { color: #f87171; }

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Pulse animation for recording active */
.pulse-ring {
  animation: pulseRing 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
}

.pulse-green {
  animation: pulseGreen 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}

/* Input & Select Styles */
.custom-input {
  background-color: #030712;
  border: 1px solid #334155;
  color: #f8fafc;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px -3px rgba(99, 102, 241, 0.5);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px -3px rgba(16, 185, 129, 0.4);
}
.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}
.btn-secondary:hover:not(:disabled) {
  background: #334155;
  color: white;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.875rem;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.25s ease-out;
}
.toast-success {
  border-left: 4px solid #10b981;
}
.toast-error {
  border-left: 4px solid #ef4444;
}
.toast-info {
  border-left: 4px solid #6366f1;
}
@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Table styles */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table th {
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid #1e293b;
  text-align: left;
}
.data-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
}
.data-table tr:hover td {
  background: rgba(30, 41, 59, 0.3);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-primary { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-slate { background: rgba(51, 65, 85, 0.3); color: #94a3b8; border: 1px solid rgba(51, 65, 85, 0.4); }

/* Active Player Highlight Card */
.player-column {
  border: 1px solid #1e293b;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  transition: all 0.25s ease;
}
.player-column.is-active-player {
  border-color: #6366f1;
  box-shadow: 0 0 20px -3px rgba(99, 102, 241, 0.35);
  background: rgba(15, 23, 42, 0.9);
}
