/* ============================================================
   styles/components.css — Navbar, Sidebar, Modal, Toast, etc.
   ============================================================ */

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--navbar-h); z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-8);
  background: rgba(10,10,27,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: left 0.3s ease;
}
.navbar-left { display: flex; align-items: center; gap: var(--sp-4); }
.navbar-right { display: flex; align-items: center; gap: var(--sp-3); }

.navbar-page-title {
  font-size: var(--text-lg); font-weight: 600;
  color: var(--text-primary);
}

.mobile-menu-btn {
  display: none;
  background: none; border: none; color: var(--text-primary);
  cursor: pointer; padding: var(--sp-2);
}
.mobile-menu-btn svg { width: 24px; height: 24px; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w); z-index: 110;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: width 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

.sidebar-logo {
  height: var(--navbar-h); padding: 0 var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 36px; height: 36px; flex-shrink: 0; }
.sidebar-logo-text {
  font-size: var(--text-xl); font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap; overflow: hidden;
  transition: opacity 0.2s, width 0.3s;
}
.sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; }

.sidebar-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--sp-4) var(--sp-3); }

.sidebar-section-label {
  font-size: var(--text-xs); font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  white-space: nowrap; overflow: hidden; transition: opacity 0.2s;
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; }

.dropdown-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: var(--text-sm); color: var(--text-secondary);
  cursor: pointer; transition: var(--t-fast);
  background: none; border: none; width: 100%; text-align: left;
  line-height: 1;
}
.dropdown-item svg { flex-shrink: 0; }

.sidebar-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-3); border-radius: var(--r-md);
  color: var(--text-secondary); font-size: var(--text-sm); font-weight: 500;
  cursor: pointer; transition: var(--t-fast); text-decoration: none;
  position: relative; white-space: nowrap;
  margin-bottom: 2px;
}
.sidebar-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.sidebar-item.active {
  background: rgba(124,58,237,0.15);
  color: var(--brand-secondary);
  border: 1px solid rgba(124,58,237,0.2);
}
.sidebar-item.active .sidebar-item-icon { color: var(--brand-secondary); }

.sidebar-item-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-item-icon svg { width: 18px; height: 18px; }
.sidebar-item-text { overflow: hidden; transition: opacity 0.2s, width 0.3s; }
.sidebar.collapsed .sidebar-item-text { opacity: 0; width: 0; }

/* Badge on sidebar item (notification count) */
.sidebar-badge {
  margin-left: auto; background: var(--brand-primary);
  color: white; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  transition: opacity 0.2s;
}
.sidebar.collapsed .sidebar-badge { opacity: 0; }

/* Tooltip when collapsed */
.sidebar.collapsed .sidebar-item::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(var(--sidebar-collapsed-w) + 8px);
  background: #1a1a35; border: 1px solid var(--border);
  color: var(--text-primary); font-size: var(--text-sm);
  padding: 6px 12px; border-radius: var(--r-md);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-md); z-index: 200;
}
.sidebar.collapsed .sidebar-item:hover::after { opacity: 1; transform: translateX(0); }

.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-legal-bar { display: none !important; }
.sidebar-legal-bar a:hover {
  color: var(--brand-400) !important;
  text-decoration: underline !important;
}
.sidebar-user {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); border-radius: var(--r-md);
  cursor: pointer; transition: var(--t-fast);
}
.sidebar-user:hover { background: var(--bg-card-hover); }
.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; transition: opacity 0.2s; }
.sidebar-user-name { font-size: var(--text-sm); font-weight: 600; }
.sidebar-user-role {
  font-size: var(--text-xs); color: var(--text-muted);
}
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

/* ── Sidebar User Flyout Popover (Zero overlap with nav items) ── */
.sidebar-user-popover {
  position: fixed;
  z-index: 9999;
  background: rgba(18, 18, 42, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: user-menu-appear 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom left;
  min-width: 230px;
}

@keyframes user-menu-appear {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.user-menu-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.user-menu-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-menu-points {
  color: var(--brand-400);
  font-weight: 600;
}

.user-menu-list {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
}
.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.user-menu-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.user-menu-item:hover svg {
  color: var(--text-primary);
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

.user-menu-item.danger {
  color: var(--error);
}
.user-menu-item.danger svg {
  color: var(--error);
}
.user-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}
.user-menu-item.danger:hover svg {
  color: #f87171;
}

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 105; backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

/* ── Responsive Sidebar & Navbar ──────────────────────────────── */
@media (max-width: 1024px) {
  .navbar { left: 0; padding: 0 var(--sp-4); }
  .mobile-menu-btn { display: block; }
  
  .sidebar {
    transform: translateX(-100%);
    z-index: 110;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar.collapsed { width: var(--sidebar-w); } /* Disable collapse on mobile */
  .sidebar.collapsed .sidebar-logo-text { opacity: 1; width: auto; }
  .sidebar.collapsed .sidebar-section-label { opacity: 1; }
  .sidebar.collapsed .sidebar-item-text { opacity: 1; width: auto; }
  .sidebar.collapsed .sidebar-user-info { opacity: 1; width: auto; }
  .sidebar.collapsed .sidebar-badge { opacity: 1; }
}

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6);
  z-index: 9999; display: flex; flex-direction: column; gap: var(--sp-3);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #1a1a35; border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  max-width: 360px; pointer-events: all;
  animation: toastIn 0.35s var(--t-spring) forwards;
  backdrop-filter: blur(20px);
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }

.toast-icon  { font-size: 20px; flex-shrink: 0; }
.toast-body  { flex: 1; min-width: 0; }
.toast-title { font-size: var(--text-sm); font-weight: 600; }
.toast-msg   { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.toast-close { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 2px; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #10102A;
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  width: 100%; max-width: 560px;
  max-height: 90dvh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s var(--t-spring);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-6); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #10102A; z-index: 1;
}
.modal-title { font-size: var(--text-lg); font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; font-size: 18px;
  transition: var(--t-fast);
}
.modal-close:hover { background: var(--error-bg); color: var(--error); border-color: transparent; }
.modal-body   { padding: var(--sp-6); }
.modal-footer {
  padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border);
  display: flex; gap: var(--sp-3); justify-content: flex-end;
}
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }

/* ── Notification Bell ───────────────────────────────────────── */
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  width: 40px; height: 40px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; font-size: 18px;
  transition: var(--t-fast); position: relative;
}
.notif-bell-btn svg { width: 18px; height: 18px; }
.notif-bell-btn:hover { border-color: var(--border-brand); color: var(--brand-secondary); }
.notif-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--error); color: white;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-base);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }

.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; background: #12122A;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl); overflow: hidden;
  z-index: 300;
}
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-title { font-size: var(--text-sm); font-weight: 700; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle); cursor: pointer;
  transition: var(--t-fast);
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { background: rgba(124,58,237,0.05); }
.notif-item-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; }
.notif-item-icon svg { width: 16px; height: 16px; }
.notif-item-body  { flex: 1; min-width: 0; }
.notif-item-title { font-size: var(--text-sm); font-weight: 600; }
.notif-item-msg   { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.notif-item-time  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-primary); flex-shrink: 0; margin-top: 6px;
}
.notif-empty { padding: var(--sp-10); text-align: center; color: var(--text-muted); font-size: var(--text-sm); }
.notif-footer { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); text-align: center; }
.notif-footer a { font-size: var(--text-sm); color: var(--brand-secondary); font-weight: 500; }

/* ── Upload card ─────────────────────────────────────────────── */
.upload-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  display: flex; gap: var(--sp-4); transition: var(--t-base);
}
.upload-card:hover { border-color: rgba(124,58,237,0.25); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.upload-thumb {
  width: 80px; height: 80px; border-radius: var(--r-md);
  object-fit: cover; flex-shrink: 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; overflow: hidden;
}
.upload-info { flex: 1; min-width: 0; }
.upload-paper { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 4px; }
.upload-title { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--sp-2); }
.upload-meta  { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.upload-date  { font-size: 11px; color: var(--text-muted); }
.upload-points { font-size: var(--text-xs); color: var(--gold); font-weight: 600; }
.upload-actions { display: flex; gap: var(--sp-2); align-items: flex-start; }

@media (max-width: 600px) {
  .upload-card {
    flex-wrap: wrap;
    padding: var(--sp-4);
  }
  .upload-thumb {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
  .upload-actions {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--sp-3);
  }
}

/* ── Paper card ──────────────────────────────────────────────── */
.paper-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-4);
  transition: var(--t-base); cursor: pointer;
}
.paper-card:hover { border-color: var(--border-brand); transform: translateY(-2px); box-shadow: var(--shadow-brand); }
.paper-thumb {
  width: 100%; height: 140px; border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(168,85,247,0.1));
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.paper-tags { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.paper-tag {
  font-size: 11px; padding: 2px 8px; border-radius: var(--r-full);
  background: rgba(124,58,237,0.1); color: var(--brand-400);
  border: 1px solid rgba(124,58,237,0.2);
}
.paper-title   { font-size: var(--text-md); font-weight: 700; }
.paper-subject { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.paper-meta    { display: flex; align-items: center; justify-content: space-between; }
.paper-answers { font-size: var(--text-xs); color: var(--text-muted); }

/* ── Star rating ─────────────────────────────────────────────── */
.star-rating { display: flex; gap: 3px; }
.star {
  font-size: 18px; cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  color: var(--text-muted);
}
.star.filled { color: var(--gold); }
.star:hover  { transform: scale(1.2); filter: brightness(1.2); }
.star-rating.readonly .star { cursor: default; }
.star-rating.readonly .star:hover { transform: none; filter: none; }
.star-rating.sm .star { font-size: 14px; }

/* ── Badge chip ──────────────────────────────────────────────── */
.badge-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3);
  transition: var(--t-base);
}
.badge-chip:hover { border-color: var(--gold-dark); box-shadow: var(--gold-glow); }
.badge-chip-icon { font-size: 18px; }
.badge-chip-text { font-size: var(--text-xs); }
.badge-chip-name { font-weight: 600; display: block; }
.badge-chip-desc { color: var(--text-muted); font-size: 11px; }

/* ── User row ────────────────────────────────────────────────── */
.user-row { display: flex; align-items: center; gap: var(--sp-4); }
.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: var(--text-sm); font-weight: 600; }
.user-email { font-size: var(--text-xs); color: var(--text-muted); }

/* ── PDF Viewer ──────────────────────────────────────────────── */
.pdf-viewer-wrap {
  background: var(--bg-surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); overflow: hidden;
}
.pdf-toolbar {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.pdf-page-info { font-size: var(--text-sm); color: var(--text-secondary); flex: 1; text-align: center; }
canvas.pdf-canvas { display: block; max-width: 100%; margin: 0 auto; }

/* ── Comment thread ──────────────────────────────────────────── */
.comment-thread { display: flex; flex-direction: column; gap: var(--sp-4); }
.comment {
  display: flex; gap: var(--sp-3);
  animation: fadeIn 0.25s ease;
}
.comment-body {
  flex: 1; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 0 var(--r-lg) var(--r-lg) var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
}
.comment-header { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.comment-author { font-size: var(--text-sm); font-weight: 600; }
.comment-time   { font-size: 11px; color: var(--text-muted); }
.comment-text   { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }
.comment-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-2); }
.comment-action {
  font-size: var(--text-xs); color: var(--text-muted); cursor: pointer;
  background: none; border: none; transition: var(--t-fast);
}
.comment-action:hover { color: var(--brand-secondary); }
.comment-input-row {
  display: flex; gap: var(--sp-3); align-items: flex-end;
}
.comment-input {
  flex: 1; resize: none; min-height: 42px; max-height: 140px;
  padding: 10px 14px; border-radius: var(--r-lg);
  font-size: var(--text-sm);
}
.comment-flagged { opacity: 0.5; font-style: italic; }

/* ── Drag-drop upload zone ───────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: var(--t-base);
  position: relative;
  background: var(--bg-card);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--border-brand);
  background: rgba(124,58,237,0.06);
}
.drop-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.drop-icon  { font-size: 48px; margin-bottom: var(--sp-4); opacity: 0.7; }
.drop-title { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--sp-2); }
.drop-sub   { color: var(--text-secondary); font-size: var(--text-sm); }
.drop-or    { margin: var(--sp-4) 0; color: var(--text-muted); font-size: var(--text-sm); }

/* ── Upload preview ──────────────────────────────────────────── */
.upload-preview {
  border-radius: var(--r-xl); border: 1px solid var(--border);
  overflow: hidden; background: var(--bg-card);
}
.upload-preview img { width: 100%; max-height: 400px; object-fit: contain; }
.upload-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border);
}
.upload-preview-name { font-size: var(--text-sm); font-weight: 500; }
.upload-preview-size { font-size: var(--text-xs); color: var(--text-muted); }

/* ── Progress bar ────────────────────────────────────────────── */
.progress-bar {
  height: 6px; border-radius: var(--r-full);
  background: var(--border); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: var(--r-full);
  background: var(--brand-gradient); transition: width 0.4s ease;
}

/* ── Announcement banner ─────────────────────────────────────── */
.announcement-banner {
  background: linear-gradient(90deg, rgba(124,58,237,0.15), rgba(168,85,247,0.08));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: flex-start; gap: var(--sp-4);
}
.announcement-icon {
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
}
.announcement-icon svg { width: 20px; height: 20px; color: var(--brand-400); }
.announcement-body { flex: 1; }
.announcement-title { font-size: var(--text-sm); font-weight: 700; margin-bottom: 4px; }
.announcement-text  { font-size: var(--text-sm); color: var(--text-secondary); }

/* ── Inline approve/reject buttons (owner queue) ─────────────── */
.action-approve {
  background: var(--success-bg); color: var(--success);
  border: 1px solid rgba(16,185,129,0.25); border-radius: var(--r-md);
  padding: 7px 16px; font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; transition: var(--t-fast);
}
.action-approve:hover { background: rgba(16,185,129,0.25); }
.action-reject  {
  background: var(--error-bg); color: var(--error);
  border: 1px solid rgba(239,68,68,0.25); border-radius: var(--r-md);
  padding: 7px 16px; font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; transition: var(--t-fast);
}
.action-reject:hover { background: rgba(239,68,68,0.25); }

/* ── Skeleton Loader ─────────────────────────────────────────── */
.skeleton {
  background-color: var(--surface-2);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/ *    % %  R o u t e   L o a d e r   ( B o o k   A n i m a t i o n )    % % % % % % % % % % % % % % % % % % % % % % % % % %  * / /* -- Mobile Overrides for Components --------------------------- */
@media (max-width: 768px) {
  .modal-overlay { padding: var(--sp-4); }
  .modal { max-height: 95dvh; }
  .modal-header, .modal-body, .modal-footer { padding: var(--sp-4); }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
}

/* ── Searchable Country Phone Input Component ───────────────── */
.phone-input-wrap {
  position: relative;
  width: 100%;
}

.phone-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: var(--t-fast);
  position: relative;
}

.phone-input-group:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
  background: var(--bg-input-focus);
}

.phone-country-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  transition: background 0.15s ease;
  border-radius: var(--r-md) 0 0 var(--r-md);
}

.phone-country-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
}

.phone-country-flag {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
}

.phone-country-code {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.phone-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.phone-country-trigger[aria-expanded="true"] .phone-chevron {
  transform: rotate(180deg);
}

.phone-input-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.phone-number-field {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.phone-number-field::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Floating searchable dropdown */
.phone-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1050;
  overflow: hidden;
  animation: phoneDropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.phone-dropdown-menu.hidden {
  display: none !important;
}

@keyframes phoneDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.phone-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.phone-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.phone-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-sm);
}

.phone-search-input::placeholder {
  color: var(--text-muted);
}

.phone-country-list {
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

.phone-country-list::-webkit-scrollbar {
  width: 6px;
}
.phone-country-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.phone-country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: background 0.12s ease;
  user-select: none;
}

.phone-country-item:hover,
.phone-country-item.highlighted {
  background: rgba(124, 58, 237, 0.15);
  color: #fff;
}

.phone-country-item.selected {
  background: rgba(124, 58, 237, 0.25);
  font-weight: 600;
}

.phone-item-flag {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.phone-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-item-dial {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.phone-country-item:hover .phone-item-dial,
.phone-country-item.highlighted .phone-item-dial {
  color: var(--brand-400);
}

.phone-country-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ── OTP Digits Inputs ───────────────────────────────────────── */
.otp-inputs {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  margin: var(--sp-3) 0;
}

.otp-input {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 700;
  border-radius: var(--r-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  caret-color: var(--brand-primary);
  transition: var(--t-fast);
}

.otp-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
  background: var(--bg-input-focus);
}

/* ── Inline Spinner ─────────────────────────────────────────── */
.spinner-sm {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--brand-secondary);
  border-radius: 50%;
  animation: inline-spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes inline-spin {
  to { transform: rotate(360deg); }
}

/* ── Global Footer & Founder Socials ────────────────────────── */
.app-global-footer {
  margin-top: auto;
  padding: var(--sp-8) 0 var(--sp-6) 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-6);
}

.footer-founder-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 440px;
}

.footer-founder-link {
  color: var(--brand-300);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--t-fast);
}
.footer-founder-link:hover {
  color: var(--brand-200);
  text-decoration: underline;
  transform: translateX(2px);
}

.footer-social-links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 2px;
  flex-wrap: wrap;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--t-fast);
}
.footer-social-btn svg {
  display: block;
}
.footer-social-btn:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--brand-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}
.footer-social-btn.github:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}
.footer-social-btn.linkedin:hover {
  color: #0A66C2;
  border-color: rgba(10, 102, 194, 0.45);
  background: rgba(10, 102, 194, 0.12);
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.25);
}
.footer-social-btn.instagram:hover {
  color: #E1306C;
  border-color: rgba(225, 48, 108, 0.45);
  background: rgba(225, 48, 108, 0.12);
  box-shadow: 0 4px 12px rgba(225, 48, 108, 0.25);
}
.footer-social-btn.youtube:hover {
  color: #FF0000;
  border-color: rgba(255, 0, 0, 0.45);
  background: rgba(255, 0, 0, 0.12);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.25);
}

.footer-nav-links {
  display: flex;
  gap: var(--sp-3) var(--sp-5);
  flex-wrap: wrap;
  align-items: center;
}
.footer-nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-xs);
  transition: var(--t-fast);
}
.footer-nav-links a:hover {
  color: var(--brand-300);
}

.footer-academic-disclaimer {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: rgba(124, 58, 237, 0.04);
  border: 1px solid rgba(124, 58, 237, 0.15);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dev-social-card {
  position: relative;
  overflow: hidden;
}
.dev-social-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 58, 237, 0.5) !important;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.18);
}

/* ── Public Pages Navigation & Founder Hero Mobile Adjustments ── */
@media (max-width: 768px) {
  .public-nav-header {
    padding: var(--sp-3) var(--sp-4) !important;
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
  .public-nav-links {
    gap: var(--sp-1) !important;
  }
  .public-nav-links .nav-link-optional {
    display: none !important;
  }
  .dev-hero-flex {
    flex-direction: column !important;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: var(--sp-5) !important;
  }
  .dev-hero-flex > div {
    min-width: 0 !important;
    width: 100% !important;
  }
  .dev-hero-flex .badge {
    font-size: 11px !important;
  }
  .app-global-footer {
    padding: var(--sp-6) 0 var(--sp-4) 0 !important;
    gap: var(--sp-4) !important;
  }
  .footer-main-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--sp-5) !important;
  }
  .footer-founder-section {
    max-width: 100% !important;
  }
  .footer-social-links {
    gap: var(--sp-2) !important;
  }
  .footer-social-btn {
    width: 38px !important;
    height: 38px !important;
  }
  .footer-nav-links {
    gap: var(--sp-2) var(--sp-4) !important;
    width: 100% !important;
  }
  .footer-nav-links a {
    padding: var(--sp-1) 0 !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: var(--text-xs) !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .footer-academic-disclaimer {
    font-size: 11px !important;
    line-height: 1.5 !important;
    padding: var(--sp-2) var(--sp-3) !important;
    word-break: break-word !important;
  }
  .footer-bottom-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--sp-2) !important;
    font-size: 11px !important;
  }
  .footer-bottom-row a {
    word-break: break-all !important;
  }
}

@media (max-width: 640px) {
  .developer-main, .about-main {
    padding: var(--sp-6) var(--sp-4) !important;
  }
  .about-footer-wrap {
    padding: 0 var(--sp-4) !important;
  }
  .about-mission-card {
    padding: var(--sp-6) var(--sp-4) !important;
  }
  .about-founder-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--sp-3) !important;
  }
  .about-founder-box .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .about-integrity-card {
    padding: var(--sp-5) var(--sp-4) !important;
  }
  .about-integrity-flex {
    flex-direction: column !important;
    gap: var(--sp-2) !important;
  }
  .about-cta-card {
    padding: var(--sp-8) var(--sp-4) !important;
  }
  .about-hero-buttons .btn,
  .about-cta-buttons .btn,
  .dev-cta-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .dev-tags-flex {
    justify-content: center !important;
  }
  .dev-contact-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: var(--sp-4) !important;
  }
  .dev-email-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (max-width: 360px) {
  .developer-main, .about-main {
    padding: var(--sp-4) var(--sp-3) !important;
  }
  .about-footer-wrap {
    padding: 0 var(--sp-3) !important;
  }
}


/* ── Mobile Responsive OTP Inputs (Modals & Auth) ─────────────── */
@media (max-width: 480px) {
  .otp-inputs {
    gap: 6px !important;
  }
  .otp-input {
    width: 38px !important;
    height: 48px !important;
    font-size: var(--text-lg) !important;
  }
}

@media (max-width: 360px) {
  .otp-inputs {
    gap: 4px !important;
  }
  .otp-input {
    width: 34px !important;
    height: 42px !important;
    font-size: var(--text-base) !important;
    padding: 0 !important;
  }
}



