/* filename: public/style.css */

:root {
  /* Modern Medical / Calming Palette */
  --bg-color: #f0f4f8;
  --card-bg: #ffffff;
  --primary: #0284c7; /* Ocean Blue */
  --primary-hover: #0369a1;
  --secondary: #e2e8f0;
  --secondary-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #cbd5e1;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;

  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  
  /* Native System Font Stack (No CDNs) */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Base Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
ul { list-style-position: inside; }

/* Layout & Navbar */
.navbar {
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 30px;
}
.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.nav-right { display: flex; align-items: center; gap: 15px; }
.nav-user { font-weight: 500; font-size: 0.9rem; color: var(--text-muted); }

.main-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 50px;
}

/* Typography Utilities */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.font-weight-bold { font-weight: 700; }
.italic { font-style: italic; }
.text-capitalize { text-transform: capitalize; }

/* Spacing & Utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.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; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1.5rem; }
.pl-4 { padding-left: 1.5rem; }
.w-100 { width: 100%; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.d-flex { display: flex; }
.d-block { display: block; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.border { border: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.border-success { border-top: 4px solid var(--success); }
.rounded { border-radius: var(--radius); }
.bg-light { background-color: #f8fafc; }
.bg-white { background-color: var(--card-bg); }
.overflow-auto { overflow: auto; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media(min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(248, 250, 252, 0.5);
}
.card-header h2 { margin: 0; }
.card-body { padding: 1.5rem; }

/* Forms & Inputs */
.form-group { display: flex; flex-direction: column; }
.form-group label { font-weight: 500; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--text-main); }
.form-control {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
textarea.form-control { resize: vertical; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); color: white; }
.btn-secondary { background-color: var(--secondary); color: var(--text-main); }
.btn-secondary:hover { background-color: var(--secondary-hover); }
.btn-outline { background-color: transparent; border-color: var(--border-color); color: var(--text-muted); }
.btn-outline:hover { background-color: var(--secondary); color: var(--text-main); }
.btn-danger { background-color: var(--danger); color: white; }
.btn-danger:hover { background-color: var(--danger-hover); }
.btn-warning { background-color: #fef08a; color: #854d0e; border-color: #fde047; }
.btn-warning:hover { background-color: #fde047; }
.btn-microsoft { background-color: #2f2f2f; color: white; }
.btn-microsoft:hover { background-color: #1a1a1a; color: white;}
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

/* Lists & Tables */
.list-group { border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; }
.list-group-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: #fff;
}
.list-group-item:last-child { border-bottom: none; }

.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th, .table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.table th { font-weight: 600; color: var(--text-muted); background: #f8fafc; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Badges & Alerts */
.badge {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background-color: var(--secondary);
  color: var(--text-muted);
}
.badge-primary { background-color: #e0f2fe; color: #0369a1; }
.badge-warning { background-color: #fef3c7; color: #b45309; }
.badge-secondary { background-color: #f1f5f9; color: #475569; }

.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.5rem; border: 1px solid transparent; }
.alert-error { background-color: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background-color: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background-color: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* Login Container */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.login-card { width: 100%; max-width: 400px; padding: 2.5rem 2rem; }

/* Report Generator Box */
.report-generator-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* Loader / Processing */
.loader {
  border: 4px solid var(--secondary);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Chat Transcript UI */
.chat-container { display: flex; flex-direction: column; gap: 15px; padding: 1rem; }
.message { display: flex; flex-direction: column; max-width: 85%; }
.message-left { align-self: flex-start; }
.message-right { align-self: flex-end; align-items: flex-end; }
.bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: opacity 0.2s;
}
.bubble:hover { opacity: 0.85; }
.message-left .bubble { background: #fff; border: 1px solid var(--border-color); border-bottom-left-radius: 2px; }
.message-right .bubble { background: var(--primary); color: white; border-bottom-right-radius: 2px; border: 1px solid var(--primary-hover); }
.speaker-name { font-size: 0.75rem; font-weight: 600; margin-bottom: 4px; }
.message-left .speaker-name { color: var(--text-muted); }
.message-right .speaker-name { color: #e0f2fe; text-align: right; }

/* Editor Specifics */
.editor-wrapper { overflow: hidden; }
.editor-toolbar {
  background: #f8fafc;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-color);
}
.editor-content-structured { padding: 30px; }
.editor-section { margin-bottom: 30px; }
.section-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 5px;
  margin-bottom: 10px;
  text-transform: capitalize;
}
.editor-field {
  min-height: 80px;
  border: 1px solid transparent;
  padding: 10px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.editor-field:hover { background: #f8fafc; border-color: #e2e8f0; }
.editor-field:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1); }
.editor-title-input {
  outline: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: -8px;
}
.editor-title-input:focus { border-color: var(--border-color); background: #f8fafc; }

/* Annotation Popup */
.annotation-popup {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  width: 380px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  z-index: 1000;
}