/* ============================================================
   MedCenter Premium - Estilo Premium Medical Tech
   Diseñado por CodexSoto | https://codexsoto.com/
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=DM+Serif+Display&display=swap');

:root {
  --color-primary: #4f46e5;
  --color-primary-dark: #3730a3;
  --color-primary-light: #6366f1;
  --color-surface: #f8fafc;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-ink: #0f172a;
  --color-muted: #64748b;
  --color-line: #e2e8f0;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.05);
  --radius: 14px;
  --radius-lg: 20px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

body {
  background-color: #f6f7f9;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Tipografia con personalidad */
h1, h2, h3 {
  letter-spacing: -0.03em;
  font-weight: 700;
}

/* ============================================================
   Scrollbar elegante
   ============================================================ */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   Animaciones suaves
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0% { background-position: -800px 0; }
  100% { background-position: 800px 0; }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-in { animation: slideInRight 0.3s ease-out forwards; }
.animate-pulse-soft { animation: pulse-soft 2.5s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ============================================================
   Skeleton loaders
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #e8ecf1 25%, #f1f5f9 50%, #e8ecf1 75%);
  background-size: 800px 100%;
  animation: shimmer 1.8s infinite linear;
  border-radius: var(--radius);
}
.skeleton-text { height: 0.875rem; margin-bottom: 0.5rem; border-radius: 6px; }
.skeleton-text:last-child { width: 60%; }

/* ============================================================
   Componentes
   ============================================================ */

/* Tarjeta refinada */
.card-premium {
  background: white;
  border: 1px solid #e8ecf1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card-premium:hover {
  box-shadow: var(--shadow-md);
}

/* Boton primario con profundidad */
.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3), 0 0 0 0 rgba(79, 70, 229, 0);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35), 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Boton secundario */
.btn-secondary {
  background: white;
  color: #4f46e5;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid #c7d2fe;
  transition: all var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-secondary:hover {
  background: #f5f3ff;
  border-color: #a5b4fc;
}

/* Input con personalidad */
.input-premium {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: all var(--transition);
  background: #fbfcfd;
  color: #1e293b;
}
.input-premium::placeholder { color: #94a3b8; }
.input-premium:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Badge de estado */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-in-consultation { background: #e0e7ff; color: #3730a3; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* Toast */
#toast-container {
  position: fixed; top: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 300px; max-width: 420px;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 0.7rem;
  font-size: 0.875rem;
  animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  background: white;
  border-left: 3px solid;
}
.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
.toast-info { border-left-color: #6366f1; }
.toast-warning { border-left-color: #f59e0b; }

/* Sidebar item */
.nav-item-active {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  color: #4f46e5;
  font-weight: 600;
  border-left: 3px solid #4f46e5;
}

/* Calendario */
.calendar-day {
  min-height: 88px;
  border: 1px solid #e8ecf1;
  padding: 0.45rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border-radius: 10px;
}
.calendar-day:hover { background: #f8fafc; border-color: #c7d2fe; }
.calendar-day-today { background: #eef2ff; border-color: #a5b4fc; }
.calendar-day-disabled { background: #f8fafc; color: #94a3b8; }
.calendar-event {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  margin-top: 0.2rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* Tabla refinada */
.table-premium { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-premium thead th {
  background: #f8fafc; color: #475569;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.8rem 1rem; text-align: left;
  border-bottom: 1px solid #e8ecf1;
}
.table-premium tbody tr { transition: background 0.12s ease; }
.table-premium tbody tr:hover { background: #f8fafc; }
.table-premium tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out forwards;
}
.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto;
  animation: fadeIn 0.3s ease-out forwards;
}

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Branding CodexSoto
   ============================================================ */
.codexsoto-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.codexsoto-brand:hover { color: #6366f1; }
.codexsoto-brand svg {
  width: 14px; height: 14px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.codexsoto-brand:hover svg { opacity: 1; }

/* Divider elegante */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 500;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass effect */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
