/* ── VDR Custom Styles ──────────────────────────────────────────────── */

:root {
  --vdr-navy: #0d1b2a;
  --vdr-navy-light: #1b2d40;
  --vdr-accent: #1a73e8;
  --vdr-accent-hover: #1558b0;
  --sidebar-width: 240px;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

body {
  background: #f4f6f9;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
}

#wrapper {
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--vdr-navy);
  color: #c9d4e0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  color: #fff !important;
  text-decoration: none;
}

.sidebar-label {
  font-size: 0.7rem;
  color: #6b8096;
  letter-spacing: 0.08em;
}

.sidebar-section-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a5568;
  padding: 0 0.5rem;
}

#sidebar .nav-link {
  color: #c9d4e0;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  transition: background 0.15s, color 0.15s;
}

#sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

#sidebar .nav-link.active {
  background: var(--vdr-accent);
  color: #ffffff;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--vdr-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--vdr-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ── Top Bar ──────────────────────────────────────────────────────────── */

.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  min-height: 52px;
  position: sticky;
  top: 0;
  z-index: 99;
}

/* ── Page Content ─────────────────────────────────────────────────────── */

#page-content {
  min-width: 0;
}

/* ── Cards ────────────────────────────────────────────────────────────── */

.card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 10px 10px 0 0 !important;
  padding: 0.75rem 1rem;
}

.folder-card .card-header {
  background: #fffbf0;
  border-bottom: 1px solid #f0e6c0;
}

/* ── Login Page ────────────────────────────────────────────────────────── */

.login-page {
  background: linear-gradient(135deg, var(--vdr-navy) 0%, #1a3a5c 100%);
}

.login-card {
  border-radius: 14px;
  border: none;
}

/* ── Tables ────────────────────────────────────────────────────────────── */

.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ── PDF Viewer ─────────────────────────────────────────────────────────── */

.pdf-viewer-container {
  background: #525659;
}

/* ── Drop Zone ──────────────────────────────────────────────────────────── */

.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  background: #f8fafc;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--vdr-accent);
  background: #eff6ff;
}

.drop-zone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.btn-xs {
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  line-height: 1.4;
}

/* ── Dashboard drag-drop zone ───────────────────────────────────────────── */

.dash-drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  padding: 1.5rem 1rem 0.75rem;
}

.dash-drop-zone.drag-active {
  border-color: var(--vdr-accent);
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(26,115,232,0.12);
}

.dash-drop-icon {
  font-size: 2.2rem;
  color: #94a3b8;
  transition: color 0.2s;
}

.dash-drop-zone.drag-active .dash-drop-icon {
  color: var(--vdr-accent);
}

.upload-progress-row {
  font-size: 0.82rem;
}

/* ── Drive browser: selected row highlight ──────────────────────────────── */

.drive-row-selected {
  background-color: rgba(13,110,253,0.07) !important;
}

.drive-row-selected td:first-child::before {
  content: "";
  display: block;
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--vdr-accent);
  border-radius: 2px 0 0 2px;
}

/* ── File browser: selected row ─────────────────────────────────────────── */

.vdr-row-selected { background-color: rgba(13,110,253,0.06) !important; }
.vdr-row-selected td:first-child { border-left: 3px solid var(--vdr-accent); }

/* ── File browser: folder drop target ───────────────────────────────────── */

.vdr-drop-target { background-color: rgba(26,115,232,0.10) !important;
                   outline: 2px dashed var(--vdr-accent); outline-offset: -2px; }

/* ── Context menu ────────────────────────────────────────────────────────── */

#ctxMenu { position:fixed; z-index:9999; background:#fff;
           border:1px solid #e2e8f0; border-radius:8px;
           box-shadow:0 4px 20px rgba(0,0,0,0.13); min-width:180px; padding:4px 0; display:none; }
.ctx-item { padding:7px 16px; cursor:pointer; font-size:.875rem; white-space:nowrap; }
.ctx-item:hover { background:#f0f4ff; }
.ctx-separator { border-top:1px solid #e2e8f0; margin:4px 0; }
.ctx-danger { color:#dc3545; }

/* ── Sync ────────────────────────────────────────────────────────────────── */

/* Floating "Syncing…" badge in bottom-right corner */
.sync-indicator {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 8500;
  background: var(--vdr-accent);
  color: #fff;
  padding: .35rem .75rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* Inline sync status icon (small, doesn't disturb row height) */
.sync-status-icon { font-size: .75rem; vertical-align: middle; }

/* Smaller xs button used in conflict/deletion tables */
.btn-xs {
  padding: .15rem .45rem;
  font-size: .75rem;
  border-radius: .25rem;
}

/* Drive folder picker list inside the add-sync modal */
#driveFolderList .list-group-item { border-left: none; border-right: none; }
#driveFolderList .list-group-item:first-child { border-top: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: -100%;
    transition: left 0.25s ease;
  }
  #sidebar.open {
    left: 0;
  }
}

/* ── Settings Hub cards ─────────────────────────────────────────────────── */

.settings-card {
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  transition: box-shadow .15s, border-color .15s, transform .1s;
  cursor: pointer;
}

.settings-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-color: #cbd5e0;
  transform: translateY(-1px);
}

.settings-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .6rem;
  font-size: 1.35rem;
}

/* ── Button system: 3-tier standardization ──────────────────────────────── */
/* Reserve btn-outline-info/success/dark/warning for semantic edge cases.   */
/* In the main UI, use: btn-primary | btn-outline-secondary | btn-outline-danger */

/* Soften outline-secondary so it reads as truly secondary */
.btn-outline-secondary {
  --bs-btn-color: #64748b;
  --bs-btn-border-color: #cbd5e0;
  --bs-btn-hover-bg: #f1f5f9;
  --bs-btn-hover-border-color: #94a3b8;
  --bs-btn-hover-color: #334155;
}

/* Keep danger clearly destructive */
.btn-outline-danger {
  --bs-btn-color: #dc2626;
  --bs-btn-border-color: #fca5a5;
}
