/* Enhanced UI/UX for QR Info Portal with Thai-Inspired Design */

/* ========================================
   THAI-INSPIRED COLOR SCHEME
   ======================================== */

:root {
  /* Primary Thai Colors */
  --thai-turquoise: #00CED1;
  --thai-turquoise-dark: #20B2AA;
  --thai-turquoise-light: #40E0D0;
  --thai-coral: #FF7F50;
  --thai-coral-dark: #FF6347;
  --thai-coral-light: #FFA07A;
  --thai-gold: #FFD700;
  --thai-gold-dark: #DAA520;
  
  /* Medical/Professional Colors */
  --medical-green: #00A86B;
  --medical-green-light: #20C997;
  --medical-blue: #0056B3;
  --medical-blue-light: #007BFF;
  
  /* Status Colors */
  --status-open: #00C851;
  --status-closed: #FF4444;
  --status-warning: #FF8800;
  --status-info: #33B5E5;
  
  /* Neutral Colors */
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

/* ========================================
   TYPOGRAPHY WITH THAI SUPPORT
   ======================================== */

/* Primary font family with Thai support */
body, 
.font-primary {
  font-family: 'Sarabun', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Enhanced Thai typography */
:lang(th) {
  font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
  line-height: 1.7;
  letter-spacing: 0.025em;
}

/* Headings enhancement */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-800);
}

.text-gradient-thai {
  background: linear-gradient(135deg, var(--thai-turquoise), var(--thai-coral));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   ENHANCED CARD COMPONENTS
   ======================================== */

.card-enhanced {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  border: 1px solid var(--gray-200);
}

.card-enhanced:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Medical-themed cards */
.card-medical {
  background: linear-gradient(135deg, rgba(0, 168, 107, 0.05), rgba(32, 201, 151, 0.05));
  border-left: 4px solid var(--medical-green);
}

/* Status cards */
.card-status-open {
  background: linear-gradient(135deg, rgba(0, 200, 81, 0.1), rgba(0, 200, 81, 0.05));
  border-left: 4px solid var(--status-open);
}

.card-status-closed {
  background: linear-gradient(135deg, rgba(255, 68, 68, 0.1), rgba(255, 68, 68, 0.05));
  border-left: 4px solid var(--status-closed);
}

.card-status-warning {
  background: linear-gradient(135deg, rgba(255, 136, 0, 0.1), rgba(255, 136, 0, 0.05));
  border-left: 4px solid var(--status-warning);
}

/* ========================================
   ENHANCED BUTTONS
   ======================================== */

.btn-enhanced {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-enhanced:focus {
  ring: 2px solid var(--thai-turquoise);
  ring-offset: 2px;
}

/* Primary Thai button */
.btn-thai-primary {
  background: linear-gradient(135deg, var(--thai-turquoise), var(--thai-turquoise-dark));
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-thai-primary:hover {
  background: linear-gradient(135deg, var(--thai-turquoise-dark), var(--thai-turquoise));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Secondary Thai button */
.btn-thai-secondary {
  background: linear-gradient(135deg, var(--thai-coral), var(--thai-coral-dark));
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-thai-secondary:hover {
  background: linear-gradient(135deg, var(--thai-coral-dark), var(--thai-coral));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Medical button */
.btn-medical {
  background: linear-gradient(135deg, var(--medical-green), var(--medical-green-light));
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-medical:hover {
  background: linear-gradient(135deg, var(--medical-green-light), var(--medical-green));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Outline buttons */
.btn-outline-thai {
  border: 2px solid var(--thai-turquoise);
  color: var(--thai-turquoise);
  background: transparent;
}

.btn-outline-thai:hover {
  background: var(--thai-turquoise);
  color: var(--white);
}

/* Large buttons for kiosk mode */
.btn-kiosk {
  padding: 1.5rem 2rem;
  font-size: 1.125rem;
  border-radius: var(--radius-lg);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
}

/* ========================================
   STATUS INDICATORS
   ======================================== */

.status-indicator {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-open {
  background: var(--status-open);
  color: var(--white);
}

.status-closed {
  background: var(--status-closed);
  color: var(--white);
}

.status-warning {
  background: var(--status-warning);
  color: var(--white);
}

.status-pulse::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background: currentColor;
  margin-right: 0.5rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   NAVIGATION ENHANCEMENTS
   ======================================== */

.nav-enhanced {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 206, 209, 0.1);
}

.nav-item-enhanced {
  position: relative;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: var(--radius);
}

.nav-item-enhanced:hover {
  color: var(--thai-turquoise);
  background: rgba(0, 206, 209, 0.1);
}

.nav-item-enhanced.active {
  color: var(--thai-turquoise);
  background: rgba(0, 206, 209, 0.1);
}

.nav-item-enhanced.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: var(--thai-turquoise);
  border-radius: var(--radius);
}

/* ========================================
   HEADER ENHANCEMENTS
   ======================================== */

.header-gradient {
  background: linear-gradient(135deg, var(--thai-turquoise) 0%, var(--thai-turquoise-dark) 50%, var(--medical-green) 100%);
  position: relative;
  overflow: hidden;
}

.header-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a"><stop offset="20%" stop-color="%23fff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23fff" stop-opacity="0"/></radialGradient></defs><circle fill="url(%23a)" cx="50" cy="10" r="10"/></svg>') repeat-x;
  opacity: 0.1;
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */

.lang-switcher {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  backdrop-filter: blur(10px);
}

.lang-option {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition);
  min-width: 2.5rem;
  text-align: center;
}

.lang-option:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.lang-option.active {
  color: var(--thai-turquoise);
  background: var(--white);
}

/* ========================================
   FORM ENHANCEMENTS
   ======================================== */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-900);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--thai-turquoise);
  box-shadow: 0 0 0 3px rgba(0, 206, 209, 0.1);
}

.form-control:invalid {
  border-color: var(--status-closed);
}

.form-control:invalid:focus {
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

/* Select styling */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 3rem;
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: var(--gray-700);
}

.loading-content .loading-spinner {
  width: 3rem;
  height: 3rem;
  border-width: 3px;
  color: var(--thai-turquoise);
  margin-bottom: 1rem;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  max-width: 24rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform var(--transition);
}

.notification.show {
  transform: translateX(0);
}

.notification-content {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.notification-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-success .notification-icon {
  background: var(--status-open);
  color: var(--white);
}

.notification-error .notification-icon {
  background: var(--status-closed);
  color: var(--white);
}

.notification-warning .notification-icon {
  background: var(--status-warning);
  color: var(--white);
}

/* ========================================
   KIOSK MODE ENHANCEMENTS
   ======================================== */

.kiosk-container {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  padding: 2rem;
  font-size: 1.125rem;
}

.kiosk-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.kiosk-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.kiosk-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.kiosk-subtitle {
  color: var(--gray-600);
  font-size: 1.125rem;
}

.kiosk-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kiosk-status {
  text-align: center;
  margin-bottom: 2rem;
}

.kiosk-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.kiosk-time {
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  color: var(--thai-turquoise);
  margin-bottom: 1rem;
}

.kiosk-date {
  text-align: center;
  font-size: 1.5rem;
  color: var(--gray-600);
  margin-bottom: 2rem;
}

/* ========================================
   QR CODE STYLING
   ======================================== */

.qr-container {
  text-align: center;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 2px dashed var(--thai-turquoise);
}

.qr-code {
  max-width: 200px;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto 1rem auto;
  display: block;
}

.qr-kiosk {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--white);
  padding: 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--thai-turquoise);
}

.qr-kiosk img {
  width: 120px;
  height: 120px;
  display: block;
}

.qr-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
  text-align: center;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-slide-up {
  animation: slideInUp 0.6s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Mobile optimizations */
@media (max-width: 640px) {
  .kiosk-time {
    font-size: 2rem;
  }
  
  .kiosk-title {
    font-size: 1.5rem;
  }
  
  .card-enhanced {
    margin-bottom: 1rem;
    border-radius: var(--radius);
  }
  
  .btn-kiosk {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-width: 150px;
  }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
  .kiosk-container {
    padding: 1.5rem;
  }
  
  .kiosk-card {
    padding: 1.5rem;
  }
}

/* Large screen optimizations */
@media (min-width: 1025px) {
  .kiosk-time {
    font-size: 4rem;
  }
  
  .kiosk-title {
    font-size: 2.5rem;
  }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Focus styles */
*:focus {
  outline: 2px solid var(--thai-turquoise);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --gray-300: #000000;
    --gray-700: #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-thai-turquoise { color: var(--thai-turquoise) !important; }
.text-thai-coral { color: var(--thai-coral) !important; }
.text-medical-green { color: var(--medical-green) !important; }

.bg-thai-turquoise { background-color: var(--thai-turquoise) !important; }
.bg-thai-coral { background-color: var(--thai-coral) !important; }
.bg-medical-green { background-color: var(--medical-green) !important; }

.border-thai-turquoise { border-color: var(--thai-turquoise) !important; }
.border-thai-coral { border-color: var(--thai-coral) !important; }
.border-medical-green { border-color: var(--medical-green) !important; }

.shadow-enhanced { box-shadow: var(--shadow) !important; }
.shadow-enhanced-md { box-shadow: var(--shadow-md) !important; }
.shadow-enhanced-lg { box-shadow: var(--shadow-lg) !important; }

.rounded-enhanced { border-radius: var(--radius) !important; }
.rounded-enhanced-lg { border-radius: var(--radius-lg) !important; }
.rounded-enhanced-xl { border-radius: var(--radius-xl) !important; }

/* Print styles */
@media print {
  .qr-container,
  .qr-code {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .no-print {
    display: none !important;
  }
}