/**
 * DoctorDirect App – Global design system
 * Aligns all pages with dashboard: brand (red/blue), semantic colors, consistent components.
 * UX standards: Delete/danger = red, Success/confirm = green, Primary = blue, Warning = amber.
 */

/* ---------- Design tokens (available everywhere) ---------- */
:root {
  --dd-red: #DC2626;
  --dd-red-hover: #b91c1c;
  --dd-red-muted: rgba(220, 38, 38, 0.12);
  --dd-blue: #2563EB;
  --dd-blue-hover: #1d4ed8;
  --dd-blue-muted: rgba(37, 99, 235, 0.12);
  --dd-green: #059669;
  --dd-green-hover: #047857;
  --dd-green-muted: rgba(5, 150, 105, 0.12);
  --dd-amber: #d97706;
  --dd-amber-muted: rgba(217, 119, 6, 0.12);
  --dd-card-radius: 0.875rem;
  --dd-radius: 0.625rem;
  --dd-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --dd-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --dd-border: #e2e8f0;
  --dd-muted: #64748b;
  --btn-radius: 0.5rem;
  --btn-py: 0.5rem;
  --btn-px: 1rem;
  --btn-fs: 0.875rem;
  --btn-fw: 500;
}

.dark {
  --dd-red-muted: rgba(220, 38, 38, 0.22);
  --dd-blue-muted: rgba(37, 99, 235, 0.22);
  --dd-green-muted: rgba(16, 185, 129, 0.2);
  --dd-amber-muted: rgba(245, 158, 11, 0.2);
  --dd-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  --dd-shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.35);
  --dd-border: rgba(255, 255, 255, 0.12);
  --dd-muted: rgba(255, 255, 255, 0.6);
}

/* ---------- Buttons (modern flat look) ---------- */
/* Base .btn */
.btn {
  padding: var(--btn-py) var(--btn-px);
  min-height: 2.25rem;
  border-radius: var(--btn-radius);
  font-size: var(--btn-fs);
  font-weight: var(--btn-fw);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-font-smoothing: antialiased;
}

/* Small buttons (e.g. table actions) – same flat look, compact size */
.btn.btn-sm {
  padding: 0.375rem 0.75rem !important;
  min-height: 1.75rem !important;
  font-size: 0.8125rem !important;
  border-radius: var(--btn-radius) !important;
}
.btn.btn-xs {
  padding: 0.25rem 0.5rem !important;
  min-height: 1.5rem !important;
  font-size: 0.75rem !important;
  border-radius: var(--btn-radius) !important;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--dd-blue);
}
.dark .btn:focus-visible {
  box-shadow: 0 0 0 2px #1e293b, 0 0 0 4px #3b82f6;
}

/* Primary = blue (flat, no gradient) */
.btn.btn-primary,
button.btn-primary {
  background-color: #2563EB !important;
  color: #fff !important;
  border: none !important;
}
.btn.btn-primary:hover,
button.btn-primary:hover {
  background-color: #1d4ed8 !important;
  color: #fff !important;
}
.btn.btn-primary:active,
button.btn-primary:active {
  background-color: #1e40af !important;
}
.dark .btn.btn-primary,
.dark button.btn-primary {
  background-color: #3b82f6 !important;
  color: #fff !important;
}
.dark .btn.btn-primary:hover,
.dark button.btn-primary:hover {
  background-color: #2563eb !important;
}

/* Info = same blue as primary (Edit, View, etc.) */
.btn.btn-info,
button.btn-info {
  background-color: #2563EB !important;
  color: #fff !important;
  border: none !important;
}
.btn.btn-info:hover,
button.btn-info:hover {
  background-color: #1d4ed8 !important;
  color: #fff !important;
}
.dark .btn.btn-info,
.dark button.btn-info {
  background-color: #3b82f6 !important;
  color: #fff !important;
}
.dark .btn.btn-info:hover,
.dark button.btn-info:hover {
  background-color: #2563eb !important;
}

/* Danger / Delete = red */
.btn.btn-danger,
button.btn-danger,
.btn.btn-destructive,
button.btn-destructive {
  background-color: #dc2626 !important;
  color: #fff !important;
  border: none !important;
}
.btn.btn-danger:hover,
button.btn-danger:hover,
.btn.btn-destructive:hover,
button.btn-destructive:hover {
  background-color: #b91c1c !important;
  color: #fff !important;
}
.btn.btn-danger:active,
.btn.btn-destructive:active {
  background-color: #991b1b !important;
}
.dark .btn.btn-danger,
.dark .btn.btn-destructive {
  background-color: #ef4444 !important;
  color: #fff !important;
}
.dark .btn.btn-danger:hover,
.dark .btn.btn-destructive:hover {
  background-color: #dc2626 !important;
}

/* Success / Confirm = green */
.btn.btn-success,
button.btn-success {
  background-color: #059669 !important;
  color: #fff !important;
  border: none !important;
}
.btn.btn-success:hover,
button.btn-success:hover {
  background-color: #047857 !important;
  color: #fff !important;
}
.btn.btn-success:active,
button.btn-success:active {
  background-color: #065f46 !important;
}

/* Secondary = neutral (ghost style) */
.btn.btn-secondary,
button.btn-secondary {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid transparent !important;
}
.btn.btn-secondary:hover,
button.btn-secondary:hover {
  background-color: #e2e8f0 !important;
  color: #334155 !important;
}
.btn.btn-secondary:active,
button.btn-secondary:active {
  background-color: #cbd5e1 !important;
}
.dark .btn.btn-secondary,
.dark button.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
}
.dark .btn.btn-secondary:hover,
.dark button.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.14) !important;
  color: #f1f5f9 !important;
}

/* Outline */
.btn.btn-outline,
.btn-default {
  background-color: transparent !important;
  border: 1px solid var(--dd-border);
  color: #475569;
}
.btn.btn-outline:hover,
.btn-default:hover {
  background-color: #f8fafc !important;
  border-color: #cbd5e1;
  color: #334155;
}
.dark .btn.btn-outline,
.dark .btn-default {
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}
.dark .btn.btn-outline:hover,
.dark .btn-default:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.3);
  color: #f1f5f9;
}

/* ---------- Cards (shadcn-card + AdminLTE .card) ---------- */
.shadcn-card,
.card.card-primary,
.card.card-outline,
.content-wrapper .card {
  border-radius: var(--dd-card-radius) !important;
  box-shadow: var(--dd-shadow) !important;
  border: 1px solid var(--dd-border) !important;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.shadcn-card:hover,
.card.card-primary:hover,
.content-wrapper .card:hover {
  box-shadow: var(--dd-shadow-hover);
}
.dark .shadcn-card,
.dark .card.card-primary,
.dark .content-wrapper .card {
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: var(--dd-shadow);
}

.shadcn-card-header,
.card .card-header {
  border-bottom: 1px solid var(--dd-border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  background: rgba(0, 0, 0, 0.02);
}
.dark .shadcn-card-header,
.dark .card .card-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.shadcn-card-title,
.card .card-title {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: #1e293b;
}
.dark .shadcn-card-title,
.dark .card .card-title {
  color: rgba(255, 255, 255, 0.95);
}

.shadcn-card-content,
.card .card-body {
  padding: 1.25rem;
}
.shadcn-card-footer,
.card .card-footer {
  border-top: 1px solid var(--dd-border);
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.02);
  gap: 0.5rem;
}
.dark .shadcn-card-footer,
.dark .card .card-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

/* ---------- Form controls ---------- */
.form-control,
input.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
textarea.form-control,
select.form-control {
  border-radius: var(--dd-radius) !important;
  border: 1px solid var(--dd-border);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
input.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea.form-control:focus,
select.form-control:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px var(--dd-blue-muted);
}
.dark .form-control,
.dark input.input,
.dark select.form-control {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}
.dark .form-control:focus,
.dark input.input:focus,
.dark select.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dark select.input option,
.dark select.input optgroup {
  background-color: #212936;
  color: #f1f5f9;
}

/* Labels */
label,
.form-group label,
.shadcn-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #475569;
}
.dark label,
.dark .form-group label {
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- Alerts (semantic colors) ---------- */
.alert-danger,
.alert.alert-danger,
.callout.callout-danger {
  background: linear-gradient(90deg, var(--dd-red-muted), rgba(220, 38, 38, 0.05));
  border-left: 4px solid var(--dd-red);
  border-radius: var(--dd-radius);
  color: #b91c1c;
}
.dark .alert-danger,
.dark .alert.alert-danger {
  background: var(--dd-red-muted);
  color: #fca5a5;
}

.alert-success,
.alert.alert-success,
.callout.callout-success {
  background: linear-gradient(90deg, var(--dd-green-muted), rgba(5, 150, 105, 0.05));
  border-left: 4px solid var(--dd-green);
  border-radius: var(--dd-radius);
  color: #047857;
}
.dark .alert-success,
.dark .alert.alert-success {
  background: var(--dd-green-muted);
  color: #6ee7b7;
}

.alert-warning,
.alert.alert-warning,
.callout.callout-warning {
  background: linear-gradient(90deg, var(--dd-amber-muted), rgba(217, 119, 6, 0.05));
  border-left: 4px solid var(--dd-amber);
  border-radius: var(--dd-radius);
  color: #b45309;
}
.dark .alert-warning,
.dark .alert.alert-warning {
  background: var(--dd-amber-muted);
  color: #fcd34d;
}

.alert-info,
.alert.alert-info,
.callout.callout-info {
  background: linear-gradient(90deg, var(--dd-blue-muted), rgba(37, 99, 235, 0.05));
  border-left: 4px solid var(--dd-blue);
  border-radius: var(--dd-radius);
  color: #1d4ed8;
}
.dark .alert-info,
.dark .callout.callout-info {
  background: var(--dd-blue-muted);
  color: #93c5fd;
}

/* ---------- Tables (DataTables + Bootstrap) ---------- */
.table,
table.dataTable {
  border-radius: var(--dd-radius);
  overflow: hidden;
  border: 1px solid var(--dd-border);
}
.table thead th,
table.dataTable thead th {
  background: #f8fafc !important;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dd-muted);
  border-bottom: 1px solid var(--dd-border);
  padding: 0.75rem 1rem;
}
.dark .table thead th,
.dark table.dataTable thead th {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.6);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.table tbody td,
table.dataTable tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--dd-border);
  font-size: 0.875rem;
}
.table tbody tr:hover,
table.dataTable tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}
.dark .table tbody tr:hover,
.dark table.dataTable tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- Badges ---------- */
.badge.badge-danger,
.badge.bg-danger,
.badge-danger {
  background: linear-gradient(135deg, #DC2626, #b91c1c) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.badge.badge-success,
.badge.bg-success,
.badge-success {
  background: linear-gradient(135deg, #059669, #047857) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.badge.badge-warning,
.badge.bg-warning,
.badge-warning {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.badge.badge-info,
.badge.bg-info,
.badge-primary {
  background: linear-gradient(135deg, #2563EB, #1d4ed8) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.badge.badge-secondary,
.badge.bg-secondary {
  background: #64748b !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* ---------- Modals ---------- */
.modal-content {
  border-radius: var(--dd-card-radius) !important;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid var(--dd-border);
}
.dark .modal-content {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}
.modal-header {
  border-bottom: 1px solid var(--dd-border);
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 1.125rem;
}
.modal-footer .btn {
  margin-left: 0.5rem;
}

/* ---------- Tabs (nav-tabs) ---------- */
.nav-tabs {
  border-bottom: 2px solid var(--dd-border);
  gap: 0.25rem;
}
.nav-tabs .nav-link {
  border: none !important;
  border-radius: var(--dd-radius) var(--dd-radius 0 0);
  font-weight: 600;
  color: var(--dd-muted);
  padding: 0.625rem 1rem;
  transition: color 0.2s, background 0.2s;
}
.nav-tabs .nav-link:hover {
  color: #475569;
  background: #f1f5f9;
}
.nav-tabs .nav-link.active {
  color: #2563EB !important;
  background: var(--dd-blue-muted) !important;
  border-bottom: 2px solid #2563EB !important;
  margin-bottom: -2px;
}
.dark .nav-tabs .nav-link {
  color: rgba(255, 255, 255, 0.6);
}
.dark .nav-tabs .nav-link:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
}
.dark .nav-tabs .nav-link.active {
  color: #93c5fd !important;
  background: var(--dd-blue-muted) !important;
  border-bottom-color: #3b82f6 !important;
}

/* ---------- Main content area ---------- */
#main-content {
  border-radius: var(--dd-card-radius);
}
