/* ===================================
   Custom CSS for Hospital HIS Workflow
   =================================== */

/* Import Thai Font */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

/* Root Variables - Hospital Theme */
:root {
  --hospital-primary: #2563eb;      /* Professional Blue */
  --hospital-secondary: #0891b2;    /* Medical Cyan */
  --hospital-accent: #06b6d4;       /* Light Cyan */
  --hospital-success: #059669;      /* Medical Green */
  --hospital-warning: #f59e0b;      /* Alert Amber */
  --hospital-danger: #dc2626;       /* Emergency Red */
  --hospital-light: #f0f9ff;        /* Light Blue Background */
  --hospital-dark: #0f172a;         /* Dark Blue */
}

/* Body and Typography */
body {
  font-family: 'Noto Sans Thai', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Header Customization */
.md-header {
  background: linear-gradient(135deg, var(--hospital-primary) 0%, var(--hospital-secondary) 100%) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.md-header__title {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Navigation Tabs */
.md-tabs {
  background: linear-gradient(135deg, var(--hospital-primary) 0%, var(--hospital-secondary) 100%) !important;
}

.md-tabs__link {
  font-weight: 500;
  opacity: 0.85;
  transition: all 0.3s ease;
}

.md-tabs__link:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
}

.md-tabs__link--active {
  opacity: 1;
  font-weight: 600;
  border-bottom: 3px solid var(--hospital-accent);
}

/* Sidebar Navigation */
.md-nav__item--active > .md-nav__link {
  color: var(--hospital-primary);
  font-weight: 600;
}

.md-nav__link:hover {
  color: var(--hospital-secondary);
}

/* Main Content Area */
.md-content {
  padding: 2rem 1rem;
}

.md-content h1 {
  color: var(--hospital-primary);
  font-weight: 700;
  border-bottom: 3px solid var(--hospital-accent);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.md-content h2 {
  color: var(--hospital-secondary);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--hospital-accent);
}

.md-content h3 {
  color: var(--hospital-dark);
  font-weight: 600;
  margin-top: 1.5rem;
}

.md-content h4 {
  color: #475569;
  font-weight: 600;
  margin-top: 1.25rem;
}

/* Admonitions - Medical Alert Styles */
.admonition {
  border-radius: 8px;
  border-left-width: 4px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.admonition.note {
  border-left-color: var(--hospital-primary);
}

.admonition.warning {
  border-left-color: var(--hospital-warning);
}

.admonition.danger {
  border-left-color: var(--hospital-danger);
}

.admonition.success {
  border-left-color: var(--hospital-success);
}

.admonition.info {
  border-left-color: var(--hospital-secondary);
}

/* Tables - Medical Data Style */
.md-typeset table:not([class]) {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.md-typeset table:not([class]) th {
  background: linear-gradient(135deg, var(--hospital-primary) 0%, var(--hospital-secondary) 100%);
  color: white;
  font-weight: 600;
  padding: 1rem;
  text-align: left;
}

.md-typeset table:not([class]) td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: var(--hospital-light);
  transition: background-color 0.2s ease;
}

/* Code Blocks */
.md-typeset code {
  background-color: #f1f5f9;
  color: #334155;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.md-typeset pre code {
  background-color: #1e293b;
  color: #e2e8f0;
}

/* Buttons and Links */
.md-typeset a {
  color: var(--hospital-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.md-typeset a:hover {
  color: var(--hospital-secondary);
  text-decoration: underline;
}

/* Search */
.md-search__input {
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.md-search__input:focus {
  background-color: white;
}

/* Footer */
.md-footer {
  background: linear-gradient(135deg, var(--hospital-dark) 0%, #1e293b 100%);
}

/* Custom Workflow Container */
.workflow-container {
  margin: 2rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.workflow-container iframe {
  border: 2px solid var(--hospital-accent);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Medical Icons and Badges */
.md-typeset .badge {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 0.875em;
  font-weight: 600;
  line-height: 1;
  border-radius: 4px;
  margin: 0 0.25em;
}

.badge-primary {
  background-color: var(--hospital-primary);
  color: white;
}

.badge-success {
  background-color: var(--hospital-success);
  color: white;
}

.badge-warning {
  background-color: var(--hospital-warning);
  color: white;
}

.badge-danger {
  background-color: var(--hospital-danger);
  color: white;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .md-content {
    padding: 1rem 0.5rem;
  }

  .workflow-container {
    padding: 0.5rem;
  }

  .workflow-container iframe {
    height: 600px;
  }
}

/* Print Styles */
@media print {
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer {
    display: none;
  }

  .md-content {
    margin: 0;
    padding: 0;
  }
}

/* Accessibility Improvements */
*:focus {
  outline: 2px solid var(--hospital-accent);
  outline-offset: 2px;
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

/* Success Message Style */
.success-message {
  background: linear-gradient(135deg, var(--hospital-success) 0%, #059669 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3);
}

/* Info Box Style */
.info-box {
  background: linear-gradient(135deg, var(--hospital-light) 0%, #dbeafe 100%);
  border-left: 4px solid var(--hospital-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Warning Box Style */
.warning-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid var(--hospital-warning);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
}
