/* Dark theme for Image Labeling Platform */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --border-color: #2a2a2a;
  --text-primary: #e5e5e5;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #3b82f6;
  --success: #22c55e;
  --error: #ef4444;
}

/* Global no-radius */
*, *::before, *::after {
  border-radius: 0 !important;
}

/* Dark scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

/* Top navbar - 40px, properly centered */
.topbar {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #111;
  border-bottom: 1px solid #222;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Nav menu */
.nav-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #888;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  transition: all 0.15s;
}

.nav-trigger:hover {
  color: #ccc;
  background: #222;
  border-color: #3a3a3a;
}

/* Page title and stats */
#page-title {
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
  line-height: 1;
}

.topbar-sep {
  color: #444;
  line-height: 1;
}

#page-stats {
  font-size: 13px;
  color: #666;
  line-height: 1;
}

/* User and logout */
.topbar-user {
  font-size: 12px;
  color: #555;
  line-height: 1;
}

#logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #555;
  transition: color 0.15s;
}

#logout-btn:hover {
  color: #888;
}

/* Dropdown menu */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 4px;
  min-width: 140px;
  z-index: 100;
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #888;
  transition: all 0.1s;
}

.nav-item:hover {
  background: #222;
  color: #ccc;
}

.nav-item.active {
  color: #6b9fff;
  background: #1e1e1e;
}


/* Focus states */
.field-focused {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px;
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

/* Canvas container */
.canvas-container {
  position: relative;
  display: inline-block;
}

/* Tri-state checkbox */
.tri-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-tertiary);
}

.tri-state.yes {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.tri-state.no {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.tri-state.na {
  background: #4a4a4a;
  border-color: #4a4a4a;
  color: var(--text-secondary);
}

/* Loading spinner */
.spinner {
  border: 3px solid var(--bg-tertiary);
  border-top: 3px solid var(--accent);
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dark input overrides for Tailwind */
input, select, textarea {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  outline: none !important;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted) !important;
}

/* Button base overrides */
button {
  transition: background 0.15s ease, border-color 0.15s ease;
}
