/* 
 * Clinical Case Simulation System
 * Custom CSS styles
 */

/* Global styles */
:root {
  --primary-color: #1a56db;
  --primary-hover: #1e429f;
  --secondary-color: #4f46e5;
  --secondary-hover: #4338ca;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --light-color: #f3f4f6;
  --dark-color: #1f2937;
  --text-color: #374151;
  --background-color: #f9fafb;
  --border-color: #e5e7eb;
  --border-radius: 0.375rem;
  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Typography improvements */
body {
  color: var(--text-color);
  line-height: 1.6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Custom Button Styles */
.btn, 
button:not([class]) {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  transition: all 0.2s ease-in-out;
}

.btn:hover, 
button:not([class]):hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active, 
button:not([class]):active {
  transform: translateY(0);
}

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

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

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

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

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

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

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

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

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

/* Button hover effect */
.button-hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Cards & Containers */
.card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.container {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

/* Form elements */
input, select, textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-color);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Navigation styles */
nav {
  background-color: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

nav a {
  color: var(--text-color);
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--primary-color);
}

.active-nav-link {
  color: var(--primary-color);
  font-weight: 600;
  border-bottom: 2px solid var(--primary-color);
}

/* Header styles */
header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: white;
  padding: 2rem 0;
}

/* Footer styles */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 2rem 0;
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }

.bg-light { background-color: var(--light-color); }
.bg-dark { background-color: var(--dark-color); }
.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.bg-success { background-color: var(--success-color); }
.bg-warning { background-color: var(--warning-color); }
.bg-danger { background-color: var(--danger-color); }

/* Responsive utilities */
@media (min-width: 576px) {
  .container { max-width: 540px; }
}

@media (min-width: 768px) {
  .container { max-width: 720px; }
}

@media (min-width: 992px) {
  .container { max-width: 960px; }
}

@media (min-width: 1200px) {
  .container { max-width: 1140px; }
}

/* Notifications */
#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.notification {
  padding: 12px 20px;
  margin-bottom: 12px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  color: white;
  max-width: 300px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.notification-info {
  background-color: var(--primary-color);
}

.notification-success {
  background-color: var(--success-color);
}

.notification-warning {
  background-color: var(--warning-color);
}

.notification-error {
  background-color: var(--danger-color);
}

.notification.fade-out {
  opacity: 0;
}

/* Clinical case specific styles */
.patient-status-stable {
  color: var(--success-color);
  font-weight: 600;
}

.patient-status-moderate {
  color: var(--warning-color);
  font-weight: 600;
}

.patient-status-serious {
  color: #f97316; /* Orange */
  font-weight: 600;
}

.patient-status-critical {
  color: var(--danger-color);
  font-weight: 600;
}

.vital-signs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
}

.vital-sign {
  padding: 8px 12px;
  background-color: #f3f4f6;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  min-width: 100px;
}

.vital-sign-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.vital-sign-value {
  font-size: 1rem;
  font-weight: 600;
}

.learning-point {
  background-color: #f0f9ff;
  border-left: 4px solid #3b82f6;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.choice-option {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choice-option:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

.choice-option.selected {
  background-color: #f0f9ff;
  border-color: #3b82f6;
}

/* Code and JSON formatting */
pre {
  background-color: #282c34;
  color: #abb2bf;
  padding: 16px;
  border-radius: var(--border-radius);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.7;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  background-color: #f3f4f6;
  padding: 2px 4px;
  border-radius: 3px;
}

.json-key {
  color: #e06c75;
}

.json-string {
  color: #98c379;
}

.json-number {
  color: #d19a66;
}

.json-boolean {
  color: #56b6c2;
}

/* Responsive table */
.responsive-table {
  width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
  display: block;
}

@media (min-width: 768px) {
  .responsive-table {
    display: table;
  }
}

.responsive-table th,
.responsive-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.responsive-table th {
  background-color: #f3f4f6;
  font-weight: 600;
}

.responsive-table tbody tr:hover {
  background-color: #f9fafb;
}

/* Restore work notice */
.restore-work-notice {
  display: none;
  background-color: #fff9db;
  border: 1px solid #fbbf24;
  border-radius: var(--border-radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}
