/* ========================================
   HOSTAL NANA - SISTEMA DE DISEÑO MODERNO
   Paleta de colores consistente con reservas.php
   ======================================== */

/* Variables CSS para consistencia */
:root {
  /* Colores principales - Paleta azul consistente */
  --primary: #8ac6d1;
  --primary-dark: #6fa5d7;
  --primary-darker: #5a8fc7;
  --primary-light: #a4caed;
  --primary-lighter: #d2e8ff;
  --primary-lightest: #f0f7ff;
  
  /* Colores secundarios */
  --secondary: #3d85c6;
  --secondary-dark: #2c5aa0;
  --secondary-darker: #1e3d6f;
  --secondary-light: #6fa5d7;
  --secondary-lighter: #b3d4ea;
  
  /* Colores de estado */
  --success: #10b981;
  --success-dark: #047857;
  --success-darker: #064e3b;
  --success-light: #34d399;
  --success-lighter: #6ee7b7;
  --success-lightest: #d1fae5;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-darker: #92400e;
  --warning-light: #fbbf24;
  --warning-lighter: #fcd34d;
  --warning-lightest: #fef3c7;
  --error: #ef4444;
  --error-dark: #dc2626;
  --error-darker: #991b1b;
  --error-light: #f87171;
  --error-lighter: #fca5a5;
  --error-lightest: #fecaca;
  
  /* Colores neutros */
  --background: #f8fafc;
  --background-secondary: #f1f5f9;
  --bg-light: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-lighter: #f8fafc;
  
  /* Variables adicionales de compatibilidad */
  --primary-color: #8ac6d1;
  --primary-hover: #6fa5d7;
  --primary-rgb: 138, 198, 209;
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mobile-padding: 1rem;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Radios */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Espaciado */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Transiciones */
  --transition-fast: 150ms ease-in-out;
  --transition: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

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

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--background) 0%, #f1f5f9 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: linear-gradient(135deg, var(--background) 0%, #f1f5f9 100%);
}

.content-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  position: relative;
  animation: slideInUp 0.6s ease-out;
}

.content-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

/* ========================================
   HEADER Y TÍTULOS
   ======================================== */

.header-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: var(--space-8) var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

.header-section h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-section .subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: var(--space-2);
  position: relative;
  z-index: 1;
}

/* ========================================
   CONTENIDO PRINCIPAL
   ======================================== */

.main-content {
  padding: var(--space-8) var(--space-6);
}

.description {
  text-align: center;
  margin-bottom: var(--space-8);
  color: var(--text-secondary);
  line-height: 1.7;
}

.description p {
  margin-bottom: var(--space-4);
}

.description strong {
  color: var(--primary);
  font-weight: 600;
}

/* ========================================
   EJEMPLOS DE DOCUMENTOS
   ======================================== */

.document-examples {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.document-example {
  text-align: center;
  transition: transform var(--transition);
}

.document-example:hover {
  transform: translateY(-4px);
}

.document-example img {
  width: 200px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition);
  border: 2px solid var(--border-light);
}

.document-example:hover img {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.document-example p {
  margin-top: var(--space-3);
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========================================
   BOTONES
   ======================================== */

.button-group {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 160px;
  height: 48px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
  pointer-events: none;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
}

.btn-secondary {
  background: var(--primary-lightest);
  color: var(--primary);
  border: 2px solid var(--primary-light);
  box-shadow: var(--shadow);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

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

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

/* ========================================
   FORMULARIOS
   ======================================== */

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--primary-lightest);
  color: var(--text-primary);
  transition: all var(--transition);
  font-family: inherit;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(138, 198, 209, 0.1);
  background: white;
}

.form-input:disabled,
.form-select:disabled {
  background: var(--border-light);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ========================================
   TABLAS
   ======================================== */

.table-container {
  margin-top: var(--space-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: var(--space-4);
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  text-align: center;
}

.table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--surface-hover);
}

.table tbody tr:nth-child(even) {
  background: rgba(138, 198, 209, 0.02);
}

/* ========================================
   MODALES
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

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

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--primary);
  overflow: hidden;
  position: relative;
  width: 90vw;
  max-width: 1000px;
  max-height: 90vh;
  animation: slideInUp 0.4s ease-out;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--secondary);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-2);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background-color var(--transition);
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 0;
  height: calc(90vh - 100px);
  overflow: hidden;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ========================================
   ESTADOS Y FEEDBACK
   ======================================== */

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-indicator.text-center {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}

.main-content .status-indicator.text-center {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}

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

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

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

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

/* ========================================
   ANIMACIONES
   ======================================== */

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

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

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

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

.loading {
  animation: pulse 2s infinite;
}

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

@media (max-width: 768px) {
  .main-container {
    padding: var(--space-4);
  }
  
  .content-card {
    max-width: 100%;
  }
  
  .header-section {
    padding: var(--space-6) var(--space-4);
  }
  
  .header-section h1 {
    font-size: 1.5rem;
  }
  
  .main-content {
    padding: var(--space-6) var(--space-4);
  }
  
  .document-examples {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }
  
  .document-example img {
    width: 150px;
  }
  
  .button-group {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .modal-content {
    width: 95vw;
    margin: var(--space-4);
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: var(--space-2);
  }
  
  .header-section h1 {
    font-size: 1.25rem;
  }
  
  .document-example img {
    width: 120px;
  }
  
  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
  }
}

/* ========================================
   UTILIDADES
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.bg-primary { background: var(--primary); }
.bg-surface { background: var(--surface); }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

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

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ========================================
   COMPONENTES ESPECÍFICOS
   ======================================== */

.faq-icon {
  width: 16px;
  height: 16px;
  cursor: pointer;
  border-radius: var(--radius);
  padding: var(--space-1);
  opacity: 0.8;
  display: inline-block;
}

.faq-icon:hover {
  background: var(--primary-lightest);
  opacity: 1;
}

/* Modal de FAQ */
#faqModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-out;
}

#faqModal.show {
  display: flex;
}

#faqModal .modal-content-unified {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

#faqModal .modal-header {
  background: var(--primary);
  color: white;
  padding: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#faqModal .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

#faqModal .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius);
  transition: background-color var(--transition);
}

#faqModal .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#faqModal .modal-body {
  padding: 0;
  height: 600px;
}

#faqModal iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive para el modal de FAQ */
@media (max-width: 768px) {
  #faqModal .modal-content-unified {
    width: 95vw;
    max-height: 95vh;
    margin: var(--space-2);
  }
  
  #faqModal .modal-body {
    height: 500px;
  }
  
  #faqModal .modal-header h3 {
    font-size: 1.1rem;
  }
  
  .faq-icon {
    width: 8px;
    height: 8px;
  }
}

.wait-indicator {
  display: none;
  text-align: center;
  padding: var(--space-8);
}

.wait-indicator img {
  width: 48px;
  height: 48px;
  animation: pulse 2s infinite;
}

/* Estilos para Select2 */
.select2-container .select2-selection--single {
  height: 48px !important;
  border: 2px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--primary-lightest) !important;
}

.select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 44px !important;
  padding-left: var(--space-4) !important;
  color: var(--text-primary) !important;
}

.select2-container--default .select2-selection--single:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(138, 198, 209, 0.1) !important;
}

.select2-dropdown {
  border: 2px solid var(--primary) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
}

.select2-results__option--highlighted[aria-selected] {
  background: var(--primary) !important;
}

/* Estilos para jQuery UI */
.ui-dialog {
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl) !important;
  border: 2px solid var(--primary) !important;
}

.ui-dialog-titlebar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
}

.ui-dialog-title {
  font-weight: 600 !important;
}

.ui-dialog-content {
  padding: var(--space-6) !important;
}

.ui-button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  border: none !important;
  border-radius: var(--radius) !important;
  color: white !important;
  font-weight: 600 !important;
  padding: var(--space-2) var(--space-4) !important;
  transition: all var(--transition) !important;
}

.ui-button:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-md) !important;
}

/* Botones con iconos - Layout en una línea */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
}

/* Botón Finalizar específico */
#checkinButton {
  margin: var(--space-4) auto;
  min-width: 200px;
  font-size: 1.1rem;
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  transition: all 0.3s ease;
}

#checkinButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

/* Contenedor del botón finalizar */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: var(--space-4);
}

/* Mensaje de checkin faltante - Rojo parpadeante */
.blinking-red {
  color: var(--error) !important;
  font-weight: 600;
  font-size: 1.1rem;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
    color: var(--error);
  }
  51%, 100% {
    opacity: 0.3;
    color: var(--error-light);
  }
}
