/* ============================================================
   BASE — GLOBAL RESET, APP SHELL, OVERLAY, AUTH
   ============================================================ */

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
}

/* APP BACKGROUND */
body {
  background: var(--color-bg);
  color: var(--color-text);
}

/* APP ROOT */
#app {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

/* ============================================================
   HEADER
   ============================================================ */

.app-header {
  height: 56px;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 10;
}

.header-left .app-logo {
  font-weight: var(--weight-semibold);
  font-size: var(--font-lg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-btn {
  background: none;
  border: none;
  font-size: var(--font-md);
  cursor: pointer;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  transition: 0.2s ease;
}

.header-btn:hover {
  background: #f0f0f0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

/* ============================================================
   PAGE CONTAINER
   ============================================================ */

#page-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  padding: var(--space-6);
  min-width: 0;
}

/* ============================================================
   MODAL LAYER + OVERLAY
   ============================================================ */

#modal-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

#modal-layer > * {
  pointer-events: auto;
}

.modal-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 120px;
  pointer-events: none;
}

.modal-wrapper > * {
  pointer-events: auto;
}

/* BLUR OVERLAY */
#overlay-blur {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(0px);
  background: rgba(0,0,0,0);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 40;
}

#overlay-blur.active {
  backdrop-filter: blur(12px);
  background: rgba(0,0,0,0.25);
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   AUTH SCREENS
   ============================================================ */

.auth-wrapper {
  width: 100%;
  height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  padding: var(--space-7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  opacity: 1;
  transform: translateY(0);
  transition: 0.3s ease;
}

.auth-card.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  position: absolute;
}

.auth-title {
  font-size: var(--font-2xl);
  font-weight: var(--weight-semibold);
  text-align: center;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.auth-field label {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}

.auth-field input {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-dark);
  font-size: var(--font-md);
  transition: 0.2s ease;
}

.auth-field input:focus {
  border-color: #888;
  outline: none;
}

.auth-btn {
  width: 100%;
  padding: var(--space-3);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-md);
  cursor: pointer;
  transition: 0.2s ease;
}

.auth-btn:hover {
  background: var(--color-accent-hover);
}

.auth-switch {
  text-align: center;
  font-size: var(--font-md);
  color: var(--color-text-muted);
}

.auth-link {
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  margin-left: 4px;
  transition: 0.2s ease;
}

.auth-link:hover {
  opacity: 0.7;
}

/* ============================================================
   USER SETTING MENU
   ============================================================ */

   .user-menu {
  position: absolute;
  top: 60px; /* adjust based on avatar position */
  right: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 8px 0;
  width: 220px;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 9999;
}

.user-menu.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.user-menu .menu-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #111;
}

.user-menu .menu-item:hover {
  background: #f3f4f6;
}

/* ============================================================
   SETTINGS
   ============================================================ */

.settings-wrapper {
  display: flex;
  height: 100%;
}

.settings-sidebar {
  width: 220px;
  background: #f8f9fa;
  border-right: 1px solid #e5e7eb;
  padding: 20px 0;
}

.settings-item {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.settings-item:hover {
  background: #e5e7eb;
}

.settings-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

/* --------------------------------------------
   SETTINGS CONTENT AREA
----------------------------------------------- */
.settings-content {
  flex: 1;
  padding: 24px;
  background: #ffffff;
  min-height: 100%;
  overflow-y: auto;
}

.settings-section {
  max-width: 640px;
}

/* Header */
.settings-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #222;
}

/* --------------------------------------------
   LABELS + DROPDOWNS
----------------------------------------------- */
.settings-section label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #444;
}

.settings-section select {
  width: 260px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #d0d4da;
  border-radius: 6px;
  background: #f9fafb;
  color: #333;
  cursor: pointer;
  transition: border 0.15s, background 0.15s;
  margin-bottom: 16px;
}

.settings-section select:hover {
  background: #f1f3f6;
}

.settings-section select:focus {
  border-color: #1a56db;
  outline: none;
  background: #fff;
}

/* --------------------------------------------
   PRIMARY BUTTONS
----------------------------------------------- */
.primary-btn {
  display: inline-block;
  padding: 8px 14px;
  background: #1a56db;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 20px;
  border: none;
}

.primary-btn:hover {
  background: #174cc7;
}

/* --------------------------------------------
   TYPES LIST
----------------------------------------------- */
.types-list {
  margin-top: 10px;
}

/* Each row */
.type-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid #e2e5e9;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #fafbfc;
  transition: background 0.15s, border 0.15s;
}

.type-item:hover {
  background: #f1f4f8;
  border-color: #d5dae0;
}

/* Color swatch */
.type-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  margin-right: 12px;
  border: 1px solid #ccc;
}

/* Name */
.type-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

/* --------------------------------------------
   ACTION BUTTONS
----------------------------------------------- */
.type-actions {
  display: flex;
  gap: 8px;
}

.type-actions button {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #d0d4da;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
}

.type-actions button:hover {
  background: #eef1f5;
  border-color: #c2c7ce;
}

/* Delete button variant */
.type-actions .delete-btn {
  color: #b00020;
  border-color: #e3b4b4;
}

.type-actions .delete-btn:hover {
  background: #ffecec;
  border-color: #d99;
}



/* ============================================================
   PLACEHOLDER (kept for dev)
   ============================================================ */

.placeholder {
  width: 100%;
  height: 300px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xl);
  color: var(--color-text-light);
}
