﻿/* =====================================================
   Doctors Spot – Global Stylesheet
   Primary brand: #1976d2 (blue)
   ===================================================== */

/* ── Variables ─────────────────────────────────────── */
:root {
  --primary:       #1976d2;
  --primary-dark:  #1565c0;
  --primary-light: #e3f2fd;
  --secondary:     #1a1a2e;
  --success:       #4caf50;
  --danger:        #f44336;
  --warning:       #ff9800;
  --info:          #2196f3;
  --text:          #333;
  --text-muted:    #666;
  --border:        #e0e0e0;
  --bg:            #f5f5f5;
  --white:         #fff;
  --radius:        4px;
  --shadow:        0 2px 8px rgba(0,0,0,.08);
  --nav-height:    60px;
}

/* ── Reset & Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ── Navbar ────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow);
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--secondary);
  text-decoration: none;
}
.brand-icon { color: var(--primary); font-size: 1.4rem; }
.brand-link:hover { text-decoration: none; }

.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-user { color: var(--text-muted); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.nav-icon {
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .2s, color .2s;
}
.nav-icon:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }

/* User link & logout button in navbar */
.nav-user-link {
  display: flex; align-items: center; gap: 7px;
  color: var(--text-muted); font-size: .9rem; text-decoration: none;
  padding: 6px 10px; border-radius: var(--radius); transition: background .15s, color .15s;
}
.nav-user-link:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.nav-logout-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: var(--radius); font-size: .88rem; font-weight: 600;
  background: transparent; border: 1.5px solid var(--border); color: var(--text-muted);
  text-decoration: none; transition: .15s;
}
.nav-logout-btn:hover { background: #fdecea; border-color: var(--danger); color: var(--danger); text-decoration: none; }

/* Admin nav */
.admin-navbar {
  background: var(--secondary);
  border-bottom: none;
}
.admin-navbar .brand-link { color: var(--white); }
.admin-navbar .nav-link {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background .2s;
}
.admin-navbar .nav-link:hover,
.admin-navbar .nav-link.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}
.admin-navbar .nav-icon { color: rgba(255,255,255,.8); }
.admin-navbar .nav-icon:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Page wrapper ────────────────────────────────────── */
.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-wrapper.wide { max-width: 1200px; }

/* ── Auth pages ─────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-card {
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 44px 40px;
  width: 100%;
  max-width: 460px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 28px;
}
.auth-logo i { color: var(--primary); font-size: 1.6rem; }
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--text-muted); }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  font-size: .9rem;
}
.form-group label .req { color: var(--primary); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="url"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color .2s;
  appearance: none;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25,118,210,.08);
}
input::placeholder,
textarea::placeholder { color: #aaa; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea { resize: vertical; min-height: 100px; }

/* Inline group (e.g. username + button) */
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }

/* Checkbox / radio */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.check-row input[type="checkbox"],
.check-row input[type="radio"] {
  width: 18px; height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}
.check-row label { font-weight: 400; cursor: pointer; }

.form-hint { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .82rem; color: var(--danger); margin-top: 4px; }

/* Date group (day/month/year selects) */
.date-group { display: flex; gap: 8px; }
.date-group select { flex: 1; }

/* File input */
.file-input-wrap { position: relative; }
.file-input-wrap input[type="file"] {
  padding: 8px 12px;
  cursor: pointer;
  font-size: .9rem;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover   { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #111; color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 13px 32px; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert i { flex-shrink: 0; margin-top: 2px; }
.alert-success { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
.alert-error   { background: #fdecea; border: 1px solid #ef9a9a; color: #c62828; }
.alert-warning { background: #fff8e1; border: 1px solid #ffe082; color: #7a5000; }
.alert-info    { background: #e3f2fd; border: 1px solid #90caf9; color: #1565c0; }

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ── Page heading ────────────────────────────────────── */
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.page-heading p  { color: var(--text-muted); font-size: .9rem; }
.page-heading hr { border: none; border-top: 1px solid var(--border); margin-top: 16px; }

/* ── Profile card (dashboard) ────────────────────────── */
.profile-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 32px;
}
.profile-card-banner {
  background: var(--secondary);
  height: 80px;
  position: relative;
}
.profile-card-body {
  padding: 0 24px 20px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-top: -36px;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--white);
  object-fit: cover;
  background: #ddd;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: #999;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info h2 { font-size: 1.1rem; font-weight: 700; margin-top: 8px; }
.profile-info p  { font-size: .85rem; color: var(--text-muted); }

/* Progress bar */
.progress-wrap { margin-bottom: 28px; }
.progress-label { display: flex; justify-content: space-between; font-size: .88rem; color: var(--text-muted); margin-bottom: 6px; }
.progress-bar-outer { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar-inner { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }

/* ── Compliance checklist ────────────────────────────── */
.compliance-section { margin-bottom: 36px; }
.compliance-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.checklist {
  position: relative;
  padding-left: 44px;
}
/* Vertical dashed connecting line */
.checklist::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 24px;
  bottom: 0;
  border-left: 2px dashed var(--primary);
  opacity: .5;
}

.checklist-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.checklist-item:last-child { border-bottom: none; }

/* Status icon */
.status-icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: 2px solid var(--primary);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  position: absolute;
  left: -44px;
  top: 14px;
  background: var(--white);
}
.status-done     { border-color: var(--success); color: var(--success); background: #e8f5e9; }
.status-rejected { border-color: var(--danger);  color: var(--danger);  background: #fdecea; }
.status-progress { border-color: var(--warning); background: #fff8e1; }
.status-empty    { border-color: var(--primary); }

.checklist-item-content { flex: 1; }
.checklist-item-content a {
  font-weight: 600;
  font-size: .97rem;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.checklist-item-content a:hover  { color: var(--primary); }
.checklist-item-content p {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Compliance form page ────────────────────────────── */
.compliance-form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
}
.compliance-form-card .form-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Multi-row entries (specialties, referees, etc.) */
.dynamic-rows .row-entry {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.dynamic-rows .row-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.remove-row {
  position: absolute;
  top: 10px; right: 10px;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 50%;
}
.remove-row:hover { background: #fdecea; }

/* ── Admin layout ────────────────────────────────────── */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-height)); }
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--secondary);
  padding: 20px 0;
  min-height: calc(100vh - var(--nav-height));
}
.admin-sidebar .sidebar-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.4);
  padding: 16px 20px 6px;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.75);
  padding: 10px 20px;
  font-size: .9rem;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.admin-sidebar a i { width: 18px; text-align: center; }

.admin-content {
  flex: 1;
  padding: 28px 32px;
  overflow: auto;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon-success { background: #e8f5e9; color: var(--success); }
.stat-icon-warning { background: #fff8e1; color: var(--warning); }
.stat-icon-info    { background: #e3f2fd; color: var(--info); }
.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); margin-bottom: 2px; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; }

/* ── Tables ──────────────────────────────────────────── */
.table-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 28px;
}
.table-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-card-header h2 { font-size: 1rem; font-weight: 700; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f9f9f9;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: 11px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  font-size: .9rem;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: capitalize;
}
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-success  { background: #e8f5e9; color: var(--success); }
.badge-danger   { background: #fdecea; color: var(--danger); }
.badge-warning  { background: #fff8e1; color: var(--warning); }
.badge-secondary{ background: #f0f0f0; color: #555; }
.badge-admin    { background: var(--secondary); color: #fff; }

/* ── Utility ─────────────────────────────────────────── */
.mt-0  { margin-top:    0    !important; }
.mt-8  { margin-top:    8px  !important; }
.mt-16 { margin-top:   16px  !important; }
.mt-24 { margin-top:   24px  !important; }
.mb-0  { margin-bottom: 0    !important; }
.mb-8  { margin-bottom: 8px  !important; }
.mb-16 { margin-bottom:16px  !important; }
.mb-24 { margin-bottom:24px  !important; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12{ gap: 12px; }
.flex-1{ flex: 1; }

/* Search bar */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.search-bar input { flex: 1; max-width: 320px; }

/* Username status indicator */
#username-status { font-size: .82rem; margin-top: 4px; }
#username-status.available { color: var(--success); }
#username-status.taken     { color: var(--danger); }
#username-status.checking  { color: var(--text-muted); }

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: .82rem;
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .page-wrapper { padding: 20px 16px 48px; }
  .auth-card { padding: 28px 20px; }
  .compliance-form-card { padding: 20px 16px; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; min-height: auto; }
  .admin-content { padding: 20px 16px; }
  .profile-card-body { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .date-group { flex-direction: column; }
  .input-group { flex-direction: column; }
}
