/* MediTriage - Estilos Globales y Responsive */

/* Variables CSS para consistencia */
:root {
  --color-primary: #4f46e5; /* indigo-600 */
  --color-primary-dark: #4338ca; /* indigo-700 */
  --color-success: #10b981; /* green-500 */
  --color-warning: #f59e0b; /* yellow-500 */
  --color-danger: #ef4444; /* red-500 */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  
  --spacing-xs: 0.25rem; /* 4px */
  --spacing-sm: 0.5rem; /* 8px */
  --spacing-md: 1rem; /* 16px */
  --spacing-lg: 1.5rem; /* 24px */
  --spacing-xl: 2rem; /* 32px */
  
  --radius-sm: 0.375rem; /* 6px */
  --radius-md: 0.5rem; /* 8px */
  --radius-lg: 0.75rem; /* 12px */
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Reset y base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utilidades responsive */
.container-responsive {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container-responsive {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-responsive {
    padding: 0 2rem;
  }
}

/* Grid responsive */
.grid-responsive {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-responsive-sm-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-responsive-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-responsive-md-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-responsive-lg-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid-responsive-lg-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tabla responsive */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  min-width: 600px;
}

/* Ocultar en móvil */
@media (max-width: 639px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Ocultar en tablet */
@media (min-width: 640px) and (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Ocultar en desktop */
@media (min-width: 1024px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Menú hamburguesa */
.mobile-menu-button {
  display: none;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: white;
}

@media (max-width: 1023px) {
  .mobile-menu-button {
    display: block;
  }
  
  .desktop-nav {
    display: none;
  }
  
  .mobile-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }
  
  .mobile-nav.open {
    max-height: 100vh;
    padding: 1rem;
  }
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
  }
  
  .mobile-nav {
    display: none;
  }
}

/* Cards responsive */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1rem;
}

@media (min-width: 768px) {
  .card {
    padding: 1.5rem;
  }
}

/* Botones responsive */
.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .btn {
    padding: 0.75rem 1.5rem;
  }
}

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

.btn-primary:hover {
  background-color: var(--color-primary-dark);
}

/* Interfaz de paciente responsive */
.patient-interface {
  min-height: 100vh;
  padding: 1rem;
}

@media (min-width: 768px) {
  .patient-interface {
    padding: 2rem;
  }
}

.patient-card {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .patient-card {
    max-width: 600px;
  }
}

.voice-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .voice-button {
    width: 100px;
    height: 100px;
  }
}

/* Panel de estadísticas responsive */
.stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Lista de pacientes responsive */
.patient-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.patient-item {
  background: white;
  padding: 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.patient-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .patient-item {
    padding: 1.5rem;
  }
}

/* Prioridad badges */
.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.priority-red {
  background-color: #fee2e2;
  color: #991b1b;
}

.priority-yellow {
  background-color: #fef3c7;
  color: #92400e;
}

.priority-green {
  background-color: #d1fae5;
  color: #065f46;
}

/* Notificaciones */
.notification-container {
  position: fixed;
  top: 80px;
  right: 1rem;
  z-index: 9999;
  max-width: 400px;
  width: calc(100% - 2rem);
}

@media (min-width: 640px) {
  .notification-container {
    width: 400px;
  }
}

.notification-toast {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease-out;
  border-left: 4px solid;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-toast.success {
  border-left-color: var(--color-success);
}

.notification-toast.warning {
  border-left-color: var(--color-warning);
}

.notification-toast.error {
  border-left-color: var(--color-danger);
}

.notification-toast.info {
  border-left-color: var(--color-primary);
}

/* Badge de notificaciones */
.notification-badge {
  position: relative;
  display: inline-block;
}

.notification-badge::after {
  content: attr(data-count);
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-danger);
  color: white;
  border-radius: 9999px;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* Spinner de carga */
.spinner {
  border: 3px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-600);
}

/* Animaciones */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

.slide-up {
  animation: slideUp 0.3s ease-out;
}

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

/* Focus visible para accesibilidad */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid var(--color-gray-300);
  }
}
