/*
 * Oparchee Healthcare Admin — Custom Styles
 * ============================================================================
 * Healthcare-specific color palette, component overrides, and custom styles
 * built on top of Sneat's Material dashboard foundation.
 */

/* ============================================================================
   1. COLOR PALETTE OVERRIDES — Healthcare Teal/Emerald Theme
   ============================================================================ */

:root {
  /* Primary — Teal */
  --bs-primary: #0891b2;
  --bs-primary-rgb: 8, 145, 178;
  --bs-primary-bg-subtle: #e0f7fa;
  --bs-primary-border-subtle: #80deea;

  /* Success — Emerald */
  --bs-success: #10b981;
  --bs-success-rgb: 16, 185, 129;
  --bs-success-bg-subtle: #d1fae5;

  /* Info — Soft Blue */
  --bs-info: #6366f1;
  --bs-info-rgb: 99, 102, 241;
  --bs-info-bg-subtle: #e0e7ff;

  /* Warning — Amber */
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;
  --bs-warning-bg-subtle: #fef3c7;

  /* Danger — Rose */
  --bs-danger: #ef4444;
  --bs-danger-rgb: 239, 68, 68;
  --bs-danger-bg-subtle: #fee2e2;

  /* Dark */
  --bs-dark: #1e293b;
  --bs-dark-rgb: 30, 41, 59;

  /* Oparchee custom tokens */
  --op-gradient-primary: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%);
  --op-gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --op-gradient-info: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --op-gradient-warning: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  --op-gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  --op-gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --op-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --op-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --op-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --op-border-radius: 0.75rem;
  --op-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   2. TYPOGRAPHY
   ============================================================================ */

body {
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #334155;
}

h1, h2, h3, h4, h5, h6 {
  color: #0f172a;
  font-weight: 600;
}

/* ============================================================================
   3. SIDEBAR — Healthcare Branded
   ============================================================================ */

.bg-menu-theme {
  background: #ffffff !important;
  border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.bg-menu-theme .menu-inner > .menu-item.active > .menu-link {
  background: rgba(8, 145, 178, 0.1) !important;
  color: #0891b2 !important;
  border-radius: 0.5rem;
  margin: 0 0.75rem;
  font-weight: 600;
}

.bg-menu-theme .menu-inner > .menu-item.active > .menu-link .menu-icon {
  color: #0891b2 !important;
}

.bg-menu-theme .menu-inner > .menu-item > .menu-link {
  color: #334155 !important;
  font-weight: 500;
  transition: var(--op-transition);
  border-radius: 0.5rem;
  margin: 2px 0.75rem;
}

.bg-menu-theme .menu-inner > .menu-item > .menu-link:hover {
  background: rgba(8, 145, 178, 0.05) !important;
  color: #0891b2 !important;
}

.bg-menu-theme .menu-inner > .menu-item > .menu-link .menu-icon {
  color: #64748b !important;
  transition: var(--op-transition);
}

.bg-menu-theme .menu-inner > .menu-item > .menu-link:hover .menu-icon {
  color: #0891b2 !important;
}

.bg-menu-theme .menu-header {
  color: #64748b !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  padding-left: 1.5rem;
}

.bg-menu-theme .menu-inner-shadow {
  background: linear-gradient(180deg, #ffffff 40%, transparent) !important;
}

.bg-menu-theme .menu-divider {
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* App Brand in Sidebar */
.app-brand .app-brand-text {
  color: #0f172a !important;
  font-weight: 700;
  font-size: 1.5rem !important;
  letter-spacing: -0.02em;
}

.app-brand .app-brand-logo .op-logo-icon {
  color: #0891b2;
}

/* ============================================================================
   4. NAVBAR
   ============================================================================ */

.layout-navbar {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: var(--op-shadow-sm);
}

.layout-navbar .navbar-nav .nav-link {
  color: #475569;
  transition: var(--op-transition);
}

.layout-navbar .navbar-nav .nav-link:hover {
  color: #0891b2;
}

/* Notification bell */
.op-notification-bell {
  position: relative;
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--op-transition);
}

.op-notification-bell:hover {
  color: #0891b2;
}

.op-notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: op-pulse 2s infinite;
}

/* ============================================================================
   5. CARDS — Healthcare Dashboard
   ============================================================================ */

.card {
  border: none;
  border-radius: var(--op-border-radius);
  box-shadow: var(--op-shadow-sm);
  transition: var(--op-transition);
  overflow: hidden;
}

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

/* KPI Stat Cards */
.op-kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--op-border-radius);
}

.op-kpi-card .op-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.op-kpi-card .op-kpi-icon.primary {
  background: var(--bs-primary-bg-subtle);
  color: #0891b2;
}

.op-kpi-card .op-kpi-icon.success {
  background: var(--bs-success-bg-subtle);
  color: #10b981;
}

.op-kpi-card .op-kpi-icon.info {
  background: var(--bs-info-bg-subtle);
  color: #6366f1;
}

.op-kpi-card .op-kpi-icon.warning {
  background: var(--bs-warning-bg-subtle);
  color: #f59e0b;
}

.op-kpi-card .op-kpi-icon.danger {
  background: var(--bs-danger-bg-subtle);
  color: #ef4444;
}

.op-kpi-card .op-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.op-kpi-card .op-kpi-label {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
}

.op-kpi-card .op-kpi-trend {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 50px;
}

.op-kpi-card .op-kpi-trend.up {
  background: var(--bs-success-bg-subtle);
  color: #059669;
}

.op-kpi-card .op-kpi-trend.down {
  background: var(--bs-danger-bg-subtle);
  color: #dc2626;
}

/* Background decoration for KPI cards */
.op-kpi-card::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.06;
  pointer-events: none;
}

.op-kpi-card.card-primary::after { background: #0891b2; }
.op-kpi-card.card-success::after { background: #10b981; }
.op-kpi-card.card-info::after { background: #6366f1; }
.op-kpi-card.card-warning::after { background: #f59e0b; }

/* Welcome Card */
.op-welcome-card {
  background: var(--op-gradient-primary);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  border-radius: var(--op-border-radius);
}

.op-welcome-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.op-welcome-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  right: 10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.op-welcome-card h5,
.op-welcome-card p {
  position: relative;
  z-index: 1;
}

.op-welcome-card h5 {
  color: #ffffff;
  font-weight: 700;
}

.op-welcome-card .btn {
  position: relative;
  z-index: 1;
}

/* ============================================================================
   6. PATIENT STATUS BADGES
   ============================================================================ */

.op-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.op-badge-admitted {
  background: #dbeafe;
  color: #1e40af;
}

.op-badge-discharged {
  background: #d1fae5;
  color: #065f46;
}

.op-badge-critical {
  background: #fee2e2;
  color: #991b1b;
  animation: op-pulse 2s infinite;
}

.op-badge-opd {
  background: #e0e7ff;
  color: #3730a3;
}

.op-badge-stable {
  background: #f0fdf4;
  color: #166534;
}

.op-badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.op-badge-confirmed {
  background: #d1fae5;
  color: #065f46;
}

.op-badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.op-badge-completed {
  background: #e0f2fe;
  color: #075985;
}

/* ============================================================================
   7. TABLES — Patient / Doctor Lists
   ============================================================================ */

.op-table {
  border-collapse: separate;
  border-spacing: 0;
}

.op-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  color: #475569;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  white-space: nowrap;
}

.op-table tbody tr {
  transition: var(--op-transition);
}

.op-table tbody tr:hover {
  background: #f0fdfa;
}

.op-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 0.875rem;
}

.op-table .op-patient-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.op-table .op-patient-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.op-table .op-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #64748b;
  transition: var(--op-transition);
  cursor: pointer;
}

.op-table .op-action-btn:hover {
  background: #f1f5f9;
  color: #0891b2;
}

/* ============================================================================
   8. APPOINTMENT CARDS
   ============================================================================ */

.op-appointment-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f1f5f9;
  transition: var(--op-transition);
}

.op-appointment-item:last-child {
  border-bottom: none;
}

.op-appointment-item:hover {
  background: #f8fafc;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 0.5rem;
}

.op-appointment-time {
  text-align: center;
  min-width: 60px;
  padding: 0.5rem;
  background: var(--bs-primary-bg-subtle);
  border-radius: 10px;
}

.op-appointment-time .time {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0891b2;
}

.op-appointment-time .period {
  font-size: 0.625rem;
  color: #0891b2;
  text-transform: uppercase;
  font-weight: 600;
}

/* ============================================================================
   9. DOCTOR CARDS
   ============================================================================ */

.op-doctor-card {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--op-border-radius);
  transition: var(--op-transition);
}

.op-doctor-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--op-shadow-lg);
}

.op-doctor-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.op-doctor-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #fff;
}

.op-doctor-status.online { background: #10b981; }
.op-doctor-status.offline { background: #94a3b8; }
.op-doctor-status.busy { background: #f59e0b; }

/* ============================================================================
   10. FOOTER
   ============================================================================ */

.content-footer {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.content-footer .footer-link {
  color: #0891b2 !important;
  font-weight: 500;
  transition: var(--op-transition);
}

.content-footer .footer-link:hover {
  color: #0e7490 !important;
}

/* ============================================================================
   11. ANIMATIONS
   ============================================================================ */

@keyframes op-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

@keyframes op-countUp {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes op-slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.op-animate-in {
  animation: op-fadeInUp 0.5s ease-out forwards;
}

.op-animate-in:nth-child(1) { animation-delay: 0.05s; }
.op-animate-in:nth-child(2) { animation-delay: 0.1s; }
.op-animate-in:nth-child(3) { animation-delay: 0.15s; }
.op-animate-in:nth-child(4) { animation-delay: 0.2s; }
.op-animate-in:nth-child(5) { animation-delay: 0.25s; }
.op-animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ============================================================================
   12. AUTH PAGES — Healthcare Style
   ============================================================================ */

.op-auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f7fa 50%, #ecfeff 100%);
}

.op-auth-card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(8, 145, 178, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.op-auth-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.op-auth-brand .logo-text {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0891b2;
  letter-spacing: -0.02em;
}

.op-auth-card .btn-primary {
  background: var(--op-gradient-primary);
  border: none;
  padding: 0.75rem;
  font-weight: 600;
  border-radius: 0.625rem;
  transition: var(--op-transition);
}

.op-auth-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(8, 145, 178, 0.25);
}

/* ============================================================================
   13. UTILITY CLASSES
   ============================================================================ */

.op-text-primary { color: #0891b2 !important; }
.op-text-success { color: #10b981 !important; }
.op-text-info { color: #6366f1 !important; }
.op-text-warning { color: #f59e0b !important; }
.op-text-danger { color: #ef4444 !important; }
.op-text-muted { color: #94a3b8 !important; }

.op-bg-primary-subtle { background: var(--bs-primary-bg-subtle) !important; }
.op-bg-success-subtle { background: var(--bs-success-bg-subtle) !important; }
.op-bg-info-subtle { background: var(--bs-info-bg-subtle) !important; }
.op-bg-warning-subtle { background: var(--bs-warning-bg-subtle) !important; }
.op-bg-danger-subtle { background: var(--bs-danger-bg-subtle) !important; }

.op-rounded-xl { border-radius: var(--op-border-radius) !important; }
.op-shadow-sm { box-shadow: var(--op-shadow-sm) !important; }
.op-shadow-md { box-shadow: var(--op-shadow-md) !important; }
.op-shadow-lg { box-shadow: var(--op-shadow-lg) !important; }

/* Quick action buttons */
.op-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--op-border-radius);
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  cursor: pointer;
  transition: var(--op-transition);
  text-decoration: none;
  color: #334155;
}

.op-quick-action:hover {
  background: #ffffff;
  border-color: #0891b2;
  box-shadow: var(--op-shadow-md);
  transform: translateY(-2px);
  color: #0891b2;
}

.op-quick-action .op-qa-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.op-quick-action .op-qa-label {
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============================================================================
   14. RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 991.98px) {
  .op-kpi-card .op-kpi-value {
    font-size: 1.375rem;
  }
}

@media (max-width: 767.98px) {
  .op-welcome-card .card-body {
    text-align: center;
  }
  
  .op-kpi-card .op-kpi-value {
    font-size: 1.25rem;
  }
}

/* ============================================================================
   15. SCROLLBAR STYLING
   ============================================================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

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

/* ============================================================================
   16. BUY NOW BUTTON REMOVAL (cleanup)
   ============================================================================ */

.buy-now {
  display: none !important;
}

/* Dashboard Elevate Hover */
.op-hover-elevate {
  transition: var(--op-transition);
}
.op-hover-elevate:hover {
  transform: translateY(-3px);
  box-shadow: var(--op-shadow-lg) !important;
}

