/* Global Styles - Mobile First Design */

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switcher {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 8px;
}

.lang-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: auto;
  min-width: auto;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.35);
  border-color: white;
}

.lang-btn--active {
  background: white !important;
  color: #2563eb !important;
  border-color: white !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* RTL layout adjustments */
[dir="rtl"] .token-item {
  border-left: none;
  border-right: 4px solid;
}

[dir="rtl"] .token-item.waiting  { border-right-color: #16a34a; }
[dir="rtl"] .token-item.skipped  { border-right-color: #f59e0b; }
[dir="rtl"] .token-item.cancelled{ border-right-color: #dc2626; }

[dir="rtl"] .alert {
  border-left: none;
  border-right: 4px solid;
}

[dir="rtl"] .alert-info    { border-right-color: #2563eb; }
[dir="rtl"] .alert-success { border-right-color: #16a34a; }
[dir="rtl"] .alert-warning { border-right-color: #f59e0b; }
[dir="rtl"] .alert-error   { border-right-color: #dc2626; }

[dir="rtl"] .arrival-message {
  border-left: none;
  border-right: 4px solid #f59e0b;
}

/* Urdu – slightly larger font for legibility */
[lang="ur"] body,
[lang="ur"] .btn,
[lang="ur"] .input-group input {
  font-size-adjust: 0.55;
  line-height: 1.9;
}



.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.stat-row:last-child {
    border-bottom: none;
}

#historyDatePicker {
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}
/* Add this to your styles.css */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px); /* This creates the modern blurred look */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.login-input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

/* Add to styles.css */
.btn-secondary {
    background-color: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
    font-size: 16px; /* Slightly smaller than the main button */
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.tab-bar {
    display: flex;
    background: #e5e7eb;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

.analytic-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
}

.analytic-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 600;
}

.analytic-value {
    font-size: 24px;
    font-weight: bold;
    color: #1e40af;
}

.analytic-description {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.btn-logout {
    background: none;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Styles */
.header {
  background: #2563eb;
  color: white;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 24px;
  margin-bottom: 5px;
}

.header p {
  font-size: 14px;
  opacity: 0.9;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Button Styles - Large Touch Targets */
.btn {
  display: inline-block;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 56px;
  min-width: 120px;
  text-align: center;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-success {
  background: #16a34a;
  color: white;
}

.btn-success:hover {
  background: #15803d;
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-secondary {
  background: #6b7280;
  color: white;
  font-size: 14px;
  padding: 8px 16px;
  min-height: 40px;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-block {
  width: 100%;
  display: block;
}

/* Input Styles */
.input-group {
  margin: 20px 0;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 16px;
}

.input-group input {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  min-height: 56px;
}

.input-group input:focus {
  outline: none;
  border-color: #2563eb;
}

/* Current Token Display - Large and Prominent */
.current-token {
  background: #eff6ff;
  border: 3px solid #2563eb;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  margin: 20px 0;
}

.current-token-label {
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 10px;
}

.current-token-number {
  font-size: 72px;
  font-weight: bold;
  color: #2563eb;
  line-height: 1;
}

.current-patient-name {
  font-size: 16px;
  color: #4b5563;
  margin-top: 10px;
  font-weight: 500;
}

.next-patient-preview {
  background: #f0fdf4;
  border: 2px solid #16a34a;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: center;
}

/* Toast Animations */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Token List */
.token-list {
  margin: 20px 0;
}

.token-item {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.token-item.waiting {
  border-left: 4px solid #16a34a;
}

.token-item.serving {
  background: #eff6ff;
  border: 2px solid #2563eb;
}

.token-item.skipped {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  opacity: 0.7;
}

.token-item.cancelled {
  background: #fee2e2;
  border-left: 4px solid #dc2626;
  opacity: 0.6;
  text-decoration: line-through;
}

.token-info {
  flex: 1;
}

.token-number {
  font-size: 32px;
  font-weight: bold;
  color: #2563eb;
  margin-right: 15px;
}

.token-name {
  font-size: 18px;
  font-weight: 600;
}

.token-status {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.token-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
  font-style: italic;
}

.token-actions {
  display: flex;
  gap: 8px;
}

/* Patient Status Page */
.status-display {
  text-align: center;
  padding: 40px 20px;
}

.your-token {
  background: #eff6ff;
  border-radius: 12px;
  padding: 30px;
  margin: 30px 0;
}

.your-token-label {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 10px;
}

.your-token-number {
  font-size: 64px;
  font-weight: bold;
  color: #2563eb;
}

.queue-info {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin: 20px 0;
}

.patients-ahead {
  font-size: 48px;
  font-weight: bold;
  color: #16a34a;
  margin: 10px 0;
}

.wait-estimate {
  font-size: 16px;
  color: #6b7280;
  margin-top: 10px;
}

.arrival-message {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
}

.arrival-message strong {
  color: #92400e;
}

/* Alert Messages */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin: 20px 0;
}

.alert-info {
  background: #dbeafe;
  border-left: 4px solid #2563eb;
  color: #1e40af;
}

.alert-success {
  background: #dcfce7;
  border-left: 4px solid #16a34a;
  color: #166534;
}

.alert-warning {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.alert-error {
  background: #fee2e2;
  border-left: 4px solid #dc2626;
  color: #991b1b;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

.spinner {
  border: 4px solid #e5e7eb;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

/* Stats */
.stats {
  display: flex;
  gap: 15px;
  margin: 20px 0;
}

.stat {
  flex: 1;
  background: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #2563eb;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
  margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 600px) {
  .container {
    padding: 15px;
  }
  
  .current-token-number {
    font-size: 56px;
  }
  
  .your-token-number {
    font-size: 48px;
  }
  
  .patients-ahead {
    font-size: 36px;
  }
  
  .token-number {
    font-size: 24px;
  }
  
  .token-actions {
    flex-direction: column;
  }
  
  .stats {
    flex-direction: column;
  }
}

/* Connection Status */
.connection-status {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 1000;
}

.connection-status.online {
  background: #dcfce7;
  color: #166534;
}

.connection-status.offline {
  background: #fee2e2;
  color: #991b1b;
}

/* Next Patient Preview */
.next-patient-preview {
  background: #eff6ff;
  border: 2px dashed #3b82f6;
  border-radius: 8px;
  padding: 12px;
  margin: 15px 0;
  text-align: center;
}

/* Toast Animations */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.success-toast {
  animation: slideIn 0.3s ease;
}

/* ============================================
   DATA EXPIRY WARNING BANNER
   ============================================ */
.expiry-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-bottom: 3px solid #f59e0b;
  padding: 12px 20px;
  z-index: 900;
}

.expiry-banner-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.expiry-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.expiry-banner-text {
  flex: 1;
  min-width: 200px;
  font-size: 14px;
  color: #78350f;
  line-height: 1.4;
}

.expiry-banner-text strong {
  display: block;
  font-size: 15px;
  color: #92400e;
  margin-bottom: 2px;
}

.expiry-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.expiry-btn-csv,
.expiry-btn-pdf {
  background: #f59e0b !important;
  color: white !important;
  border: none !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  min-height: auto !important;
  min-width: auto !important;
  transition: background 0.2s !important;
}

.expiry-btn-csv:hover,
.expiry-btn-pdf:hover {
  background: #d97706 !important;
}

.expiry-btn-dismiss {
  background: transparent !important;
  border: 1px solid #d97706 !important;
  color: #92400e !important;
  padding: 6px 10px !important;
  font-size: 14px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  min-height: auto !important;
  min-width: auto !important;
}

.expiry-btn-dismiss:hover {
  background: rgba(217, 119, 6, 0.1) !important;
}

/* ============================================
   EXPORT BUTTONS
   ============================================ */
.export-btn {
  background: #2563eb !important;
  color: white !important;
  border: none !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  min-height: auto !important;
  min-width: auto !important;
  transition: all 0.2s !important;
}

.export-btn:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px);
}

/* ============================================
   PRINT CONTAINER (hidden on screen)
   ============================================ */
.print-container {
  display: none;
}

@media print {
  /* Hide everything except the print container */
  body > *:not(.print-container) {
    display: none !important;
  }

  .print-container {
    display: block !important;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: #000;
  }

  .print-container h1 {
    font-size: 22px;
    margin-bottom: 5px;
    color: #1e40af;
  }

  .print-container .print-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
  }

  .print-container .print-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }

  .print-container .print-stat {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
  }

  .print-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 13px;
  }

  .print-container th {
    background: #2563eb;
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
  }

  .print-container td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
  }

  .print-container tr:nth-child(even) {
    background: #f9fafb;
  }

  .print-container .print-footer {
    margin-top: 20px;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
  }
}