/* Professional Medical Theme Colors */

:root {
  --color-primary-blue: #0369a1;
  --color-primary-light: #e0f2fe;
  --color-teal-accent: #14b8a6;
  --color-success: #16a34a;
  --color-warning: #ea580c;
  --color-error: #dc2626;
  --color-neutral: #f8fafc;
  --color-border: #e2e8f0;
}

/* Body and Page Background */
body {
  background: #f0f9ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Card Styling - Professional Medical Look */
.card,
.bg-white {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(3, 105, 161, 0.05);
}

.card:hover {
  border-color: #0369a1;
  box-shadow: 0 4px 12px 0 rgba(3, 105, 161, 0.1);
  transition: all 0.3s ease;
}

/* Alert Styling */
.alert-notice {
  background: #dcfce7;
  border-left: 4px solid #16a34a;
  padding: 1rem;
  border-radius: 0.375rem;
  display: flex;
  gap: 1rem;
}

.alert-notice-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  color: #16a34a;
}

.alert-notice-content {
  flex: 1;
}

.alert-notice-content p {
  margin: 0;
  color: #166534;
  font-size: 0.875rem;
}

.alert-notice-content p:first-child {
  font-weight: 600;
  font-size: 0.95rem;
  color: #15803d;
}

.alert-error {
  background: #fee2e2;
  border-left: 4px solid #dc2626;
  padding: 1rem;
  border-radius: 0.375rem;
  display: flex;
  gap: 1rem;
}

.alert-error-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  color: #dc2626;
}

.alert-error-content {
  flex: 1;
}

.alert-error-content p {
  margin: 0;
  color: #7f1d1d;
  font-size: 0.875rem;
}

.alert-error-content p:first-child {
  font-weight: 600;
  font-size: 0.95rem;
  color: #991b1b;
}

/* Headers */
h1, h2, h3, h4 {
  color: #0c2340;
  font-weight: 600;
}

/* Links */
a:not([class*="bg-"]):not([class*="btn"]) {
  color: #0369a1;
  text-decoration: none;
}

a:not([class*="bg-"]):not([class*="btn"]):hover {
  color: #075985;
  text-decoration: underline;
}

/* Ensure links with background colors maintain proper text color */
a.bg-purple-600, 
a.bg-purple-700,
a.bg-blue-600,
a.bg-blue-700,
a[class*="bg-red"],
a[class*="bg-green"],
a[class*="bg-indigo"] {
  color: #fff !important;
}

a.bg-purple-600:hover, 
a.bg-purple-700:hover,
a.bg-blue-600:hover,
a.bg-blue-700:hover,
a[class*="bg-red"]:hover,
a[class*="bg-green"]:hover,
a[class*="bg-indigo"]:hover {
  color: #fff !important;
  text-decoration: none;
}

/* Buttons - Professional Medical Style */
.btn,
button,
input[type="submit"],
input[type="button"] {
  background-color: #0369a1;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(3, 105, 161, 0.15);
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: #075985;
  box-shadow: 0 12px 24px rgba(3, 105, 161, 0.2);
}

.btn-secondary {
  background-color: #14b8a6;
}

.btn-secondary:hover {
  background-color: #0d9488;
}

.btn-success {
  background-color: #16a34a;
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-warning {
  background-color: #ea580c;
}

.btn-warning:hover {
  background-color: #c2410c;
}

.btn-error {
  background-color: #dc2626;
}

.btn-error:hover {
  background-color: #b91c1c;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  background-color: #1d4ed8;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(14, 165, 233, 0.5);
  box-shadow: 0 4px 6px rgba(14, 165, 233, 0.15);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: #1e40af;
  box-shadow: 0 6px 8px rgba(14, 165, 233, 0.2);
  text-decoration: none;
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.35);
  outline-offset: 2px;
}

.btn-primary svg {
  width: 1rem;
  height: 1rem;
  color: inherit;
}

/* Input Styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #0369a1;
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

/* Badge Colors */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background-color: #dbeafe;
  color: #0c4a6e;
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-warning {
  background-color: #fed7aa;
  color: #92400e;
}

.badge-error {
  background-color: #fee2e2;
  color: #7f1d1d;
}

.badge-info {
  background-color: #cffafe;
  color: #164e63;
}

/* Status & Priority Badges */
.status-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-badge:hover,
.priority-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.status-badge--approved {
  background: #d1fae5;
  color: #0f766e;
  border-color: #99f6e4;
}

.status-badge--under-review {
  background: #bfdbfe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.status-badge--draft,
.status-badge--default {
  background: #e2e8f0;
  color: #475569;
  border-color: #cbd5f5;
}

.status-badge--rejected {
  background: #fecaca;
  color: #b91c1c;
  border-color: #fca5a5;
}

.status-badge--obsolete {
  background: #e2e8f0;
  color: #475569;
  border-color: #cbd5f5;
}

.priority-badge--critical {
  background: #fecaca;
  color: #991b1b;
  border-color: #fca5a5;
}

.priority-badge--high {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fdba74;
}

.priority-badge--medium {
  background: #fde68a;
  color: #a16207;
  border-color: #fcd34d;
}

.priority-badge--low {
  background: #cffafe;
  color: #0f766e;
  border-color: #99f6e4;
}

.priority-badge--default {
  background: #e2e8f0;
  color: #475569;
  border-color: #cbd5f5;
}

/* Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table thead {
  background-color: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
}

table th {
  padding: 0.75rem;
  text-align: left;
  color: #0c2340;
  font-weight: 600;
}

table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

table tbody tr:hover {
  background-color: #f8fafc;
}

/* Professional Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  background: #0369a1;
  color: white;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.section-header h1 {
  color: white;
  margin: 0;
  font-size: 1.875rem;
}

.section-header p {
  color: #bfdbfe;
  margin: 0.5rem 0 0 0;
}

/* Medical Dashboard Stats */
.stat-card {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #0369a1;
}

.stat-card .stat-trend {
  font-size: 0.75rem;
  color: #64748b;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #0c2340;
}

/* Sidebar Active State */
.sidebar-active {
  background-color: white;
  color: #0369a1;
  border-left: 4px solid #0369a1;
}

/* Professional List Items */
.list-item {
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.list-item:hover {
  border-color: #0369a1;
  background-color: #f0f9ff;
}

/* Status Indicators */
.status-approved {
  color: #16a34a;
}

.status-pending {
  color: #ea580c;
}

.status-rejected {
  color: #dc2626;
}

.status-draft {
  color: #64748b;
}

/* Grid Layout */
.grid-professional {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Print Styles */
@media print {
  body {
    background: white;
  }
  
  .sidebar,
  .no-print {
    display: none;
  }
  
  main {
    width: 100%;
  }
}

/* Rich Text Editor Styling */
.trix-editor-wrapper {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.trix-editor-wrapper:has(trix-editor:focus) {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

trix-editor {
  border: none !important;
  border-radius: 0 !important;
  min-height: 200px;
  padding: 1rem !important;
  font-size: 0.95rem;
  line-height: 1.6;
}

trix-toolbar {
  background: #f3f4f6 !important;
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;
  padding: 0.75rem 0.5rem !important;
}

trix-toolbar .trix-button-row {
  gap: 0.25rem !important;
  margin-bottom: 0 !important;
}

trix-toolbar .trix-button-group {
  background: white !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  margin-bottom: 0 !important;
}

trix-toolbar .trix-button {
  padding: 0.6rem 0.75rem !important;
  transition: all 0.2s ease !important;
  color: #374151 !important;
}

trix-toolbar .trix-button:hover:not(:disabled) {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

trix-toolbar .trix-button.trix-active {
  background: #dbeafe !important;
  color: #1e40af !important;
}

trix-toolbar .trix-dialog {
  background: white !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
  border-radius: 0.5rem !important;
  padding: 1rem !important;
}

trix-toolbar .trix-input--dialog {
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  padding: 0.6rem 0.8rem !important;
  font-size: 0.9rem;
}

trix-toolbar .trix-input--dialog:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Content Display */
.trix-content {
  line-height: 1.6;
  color: #1f2937;
}

.trix-content h1, .trix-content h2, .trix-content h3 {
  color: #111827;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
}

.trix-content blockquote {
  border-left-color: #3b82f6;
  padding-left: 1rem;
  color: #4b5563;
}

.trix-content pre {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 1rem;
}

.trix-content code {
  background: #f3f4f6;
  border-radius: 0.25rem;
  padding: 0.2rem 0.4rem;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}
