/* ===========================================
   MediCitas - Custom Styles
   =========================================== */

/* Variables CSS */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #059669;
  --secondary-dark: #047857;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
}

/* Dark mode */
.dark {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
}

/* Transiciones suaves */
* {
  transition-property: color, background-color, border-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

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

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

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

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateY(-10px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-slideIn {
  animation: slideIn 0.3s ease-out;
}

.animate-slideInRight {
  animation: slideInRight 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spinner de carga */
.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

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

/* Cards con hover */
.card-hover {
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
}

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

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

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

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

/* Form inputs */
.input-focus:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Calendar styles */
.calendar-day {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s;
}

.calendar-day:hover:not(.disabled) {
  background-color: #e0e7ff;
}

.calendar-day.selected {
  background-color: var(--primary);
  color: white;
}

.calendar-day.today {
  border: 2px solid var(--primary);
}

.calendar-day.disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

/* Time slots */
.time-slot {
  padding: 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
}

.time-slot:hover:not(.disabled) {
  border-color: var(--primary);
  background-color: #eff6ff;
}

.time-slot.selected {
  border-color: var(--primary);
  background-color: var(--primary);
  color: white;
}

.time-slot.disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Sidebar */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: #64748b;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.sidebar-link.active {
  background-color: #eff6ff;
  color: var(--primary);
  font-weight: 500;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  animation: slideInRight 0.3s ease-out;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgb(0 0 0 / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 28rem;
  width: 100%;
  margin: 1rem;
  animation: slideIn 0.3s ease-out;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: rgb(255 255 255 / 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9997;
}

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

/* Avatar placeholder */
.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

/* Responsive helpers */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    transition: left 0.3s;
  }
  
  .sidebar.open {
    left: 0;
  }
}
