/* ===== CSS Reset & Variables ===== */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

:root {
  --glass-bg: rgba(255,255,255,0.08);
  --glass-bg-hover: rgba(255,255,255,0.14);
  --glass-border: rgba(255,255,255,0.15);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.25);
  --blur: 20px;
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.75);
  --text-muted: rgba(255,255,255,0.5);
  --accent: #6366f1;
  --accent-glow: rgba(99,102,241,0.4);
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
  width: 100%; height: 100%;
  font-family: var(--font);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Background ===== */
.bg-layer {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden;
}

.bg-image {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: bgBreath 30s ease-in-out infinite alternate;
  transition: opacity 0.8s ease;
}

.bg-layer::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.1) 35%,
    transparent 55%,
    rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}

@keyframes bgBreath {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* ===== Top Bar ===== */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 30px;
  z-index: 100;
}

.clock {
  animation: fadeInDown 0.6s ease;
}

.clock-time {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 2px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.4);
  line-height: 1;
}

.clock-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.4);
}

.top-actions {
  display: flex; gap: 10px; align-items: center;
  animation: fadeInDown 0.6s ease 0.1s both;
}

.glass-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
  white-space: nowrap;
}

.glass-btn:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.glass-btn svg, .user-menu-item svg {
  vertical-align: -3px;
  flex-shrink: 0;
}

.glass-btn.icon-btn {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-btn.icon-btn svg {
  vertical-align: middle;
}

/* ===== Search ===== */
.search-wrapper {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 120px;
  animation: fadeInUp 0.7s ease 0.2s both;
}

.search-engines {
  display: flex; gap: 4px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 4px;
  margin-bottom: 12px;
}

.engine-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.85);
  padding: 6px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: var(--transition);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.engine-btn:hover { color: #fff; }

.engine-btn.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.search-box {
  position: relative;
  width: min(600px, 90vw);
}

.search-input {
  width: 100%;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 25px;
  padding: 14px 50px 14px 24px;
  color: #fff;
  font-size: 16px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}

.search-input::placeholder { color: rgba(255,255,255,0.55); }

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--glass-shadow);
  background: rgba(0,0,0,0.35);
}

.search-submit {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer; padding: 8px;
  transition: var(--transition);
}

.search-submit:hover { color: var(--text-primary); }

/* ===== Navigation Container ===== */
.nav-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 20px 100px;
}

.nav-category {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--glass-shadow);
  animation: fadeInUp 0.6s ease both;
}

.nav-category:nth-child(1) { animation-delay: 0.3s; }
.nav-category:nth-child(2) { animation-delay: 0.4s; }
.nav-category:nth-child(3) { animation-delay: 0.5s; }
.nav-category:nth-child(4) { animation-delay: 0.6s; }

.category-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.category-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.category-name.editing-name {
  outline: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  min-width: 60px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px 4px 0 0;
  padding: 2px 6px;
}

/* ===== Custom Confirm Dialog ===== */
.confirm-overlay {
  transition: opacity 0.2s ease;
}

.confirm-dialog {
  width: min(360px, 85vw) !important;
  padding: 32px !important;
  text-align: center;
}

.confirm-icon {
  color: var(--danger);
  margin-bottom: 16px;
  opacity: 0.9;
}

.confirm-icon svg {
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.3));
}

.confirm-message {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
}

.confirm-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.confirm-btn.cancel {
  background: rgba(255,255,255,0.1);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.confirm-btn.cancel:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text-primary);
}

.confirm-btn.danger {
  background: var(--danger);
  color: #fff;
}

.confirm-btn.danger:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.category-actions {
  display: none; gap: 6px;
}

.editing .category-actions { display: flex; }

.cat-action-btn {
  background: rgba(255,255,255,0.1);
  border: none; color: var(--text-secondary);
  width: 28px; height: 28px;
  border-radius: 6px; cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.cat-action-btn svg {
  pointer-events: none;
}

.cat-action-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.cat-action-btn.danger:hover { background: rgba(239,68,68,0.3); color: var(--danger); }

.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 16px;
}

.bookmark-item {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.bookmark-item:hover {
  transform: translateY(-4px);
}

.bookmark-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  transition: var(--transition);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.bookmark-icon.has-icon {
  background: #fff !important;
  padding: 6px;
}

.bookmark-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.bookmark-item:hover .bookmark-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.bookmark-title {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.bookmark-delete {
  display: none;
  position: absolute; top: -6px; right: 2px;
  background: var(--danger);
  color: #fff; border: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 12px; cursor: pointer;
  line-height: 1;
  z-index: 5;
}

.editing .bookmark-delete { display: none; }

.bookmark-add {
  display: none;
  flex-direction: column; align-items: center;
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition);
}

.editing .bookmark-add { display: flex; }

.bookmark-add:hover { opacity: 1; transform: translateY(-4px); }

.bookmark-add .bookmark-icon {
  background: rgba(255,255,255,0.1);
  border: 2px dashed var(--glass-border);
  font-size: 24px;
}

/* ===== Drag & Drop ===== */
.bookmark-item[draggable="true"] {
  cursor: grab;
}

.bookmark-item[draggable="true"]:active {
  cursor: grabbing;
}

.bookmark-item.dragging {
  opacity: 0.3;
  transform: scale(0.9);
}

.bookmark-grid.drop-zone {
  min-height: 70px;
  border-radius: var(--radius-xs);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bookmark-grid.drop-hover {
  background: rgba(99, 102, 241, 0.06);
  outline: 2px dashed rgba(99, 102, 241, 0.4);
  outline-offset: 4px;
  border-radius: var(--radius-xs);
}

.drop-indicator {
  width: 4px;
  height: 60px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 -2px;
  align-self: center;
  box-shadow: 0 0 10px var(--accent-glow);
  animation: dropPulse 0.8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes dropPulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* ===== Bookmark Edit Button ===== */
.bookmark-edit {
  display: none;
  position: absolute; top: -6px; right: 2px;
  background: var(--accent);
  color: #fff; border: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  align-items: center; justify-content: center;
  transition: var(--transition);
  padding: 0;
}

.bookmark-edit svg {
  display: block;
  margin: auto;
}

.editing .bookmark-edit { display: flex; }

.bookmark-edit:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Adjust delete button position when edit button is present */
.editing .bookmark-item {
  cursor: grab;
}

.editing .bookmark-item:hover {
  transform: translateY(-4px);
}

/* Edit mode footer */
.edit-footer {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  padding: 16px;
  justify-content: center; gap: 12px;
  z-index: 200;
  animation: fadeInUp 0.3s ease;
}

.edit-footer.show { display: flex; }

.edit-footer .glass-btn { padding: 10px 24px; }

/* ===== Modals ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  position: relative;
  width: min(420px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  animation: modalPop 0.35s var(--bounce);
}

.glass-card {
  background: rgba(30,30,50,0.55);
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.06);
}

.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 24px; cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.modal-close:hover { color: var(--text-primary); transform: rotate(90deg); }

.modal h3 {
  font-size: 20px; font-weight: 600;
  margin-bottom: 20px;
}

/* ===== Delete Button in Edit Form ===== */
/* Delete button styles now scoped under .edit-card */

/* ===== Auth ===== */
.auth-card {
  width: min(400px, 90vw) !important;
  padding: 0 !important;
  overflow: hidden;
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2) !important;
}

.auth-card .modal-close { color: #666; }
.auth-card .modal-close:hover { color: #333; }
.auth-card .auth-title { color: #1a1a2e; }
.auth-card .auth-subtitle { color: #888; }
.auth-card .auth-tab { color: #999; }
.auth-card .auth-tab.active { color: #333; }
.auth-card .auth-tabs { background: rgba(0,0,0,0.04); }
.auth-card .auth-tab-indicator { background: rgba(0,0,0,0.06); }
.auth-card .input-group svg { color: #bbb; }
.auth-card .input-group:focus-within svg { color: var(--accent); }
.auth-card .auth-form input {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.1);
  color: #333;
}
.auth-card .auth-form input::placeholder { color: #aaa; }
.auth-card .auth-form input:focus {
  border-color: var(--accent);
  background: #fff;
}

.auth-header {
  text-align: center;
  padding: 32px 32px 20px;
  position: relative;
}

.auth-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  pointer-events: none;
}

@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(99,102,241,0); }
}

.auth-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #fff;
  position: relative;
  z-index: 1;
  animation: avatarPulse 2.5s ease-in-out infinite;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin: 0 28px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 3px;
  position: relative;
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  transition: color 0.3s;
  z-index: 1;
  position: relative;
}

.auth-tab.active {
  color: var(--text-primary);
}

.auth-tab-indicator {
  position: absolute;
  top: 3px; bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 28px 28px;
}

@keyframes authFieldIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-form .input-group {
  animation: authFieldIn 0.4s ease forwards;
  opacity: 0;
}

.auth-form .input-group:nth-child(1) { animation-delay: 0.1s; }
.auth-form .input-group:nth-child(2) { animation-delay: 0.2s; }
.auth-form .input-group:nth-child(3) { animation-delay: 0.3s; }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s;
}

.input-group input {
  padding-left: 42px !important;
  width: 100%;
}

.input-group:focus-within svg {
  color: var(--accent);
}

.auth-form input, .glass-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}

.auth-form input:focus, .glass-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255,255,255,0.1);
}

.auth-form input::placeholder { color: var(--text-muted); }

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  animation: authFieldIn 0.4s ease 0.35s forwards;
  opacity: 0;
}

.auth-submit svg {
  transition: transform 0.3s;
}

.auth-submit:hover svg {
  transform: translateX(4px);
}

.auth-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 0;
  text-align: center;
}

/* ===== Icon Section in Edit Form ===== */
/* ===== Edit Card (White Theme) ===== */
.edit-card {
  width: min(400px, 90vw) !important;
  padding: 0 !important;
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important;
}

.edit-card .modal-close { color: #999; }
.edit-card .modal-close:hover { color: #333; }

.edit-header {
  padding: 20px 24px 0;
}

.edit-header h3 {
  font-size: 18px; font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.edit-form {
  display: flex; flex-direction: column;
  gap: 12px;
  padding: 14px 24px 24px;
}

.edit-field {
  display: flex; flex-direction: column; gap: 4px;
}

.edit-row {
  display: flex; gap: 12px;
}

.edit-label {
  font-size: 12px; font-weight: 600;
  color: #888; text-transform: uppercase;
  letter-spacing: 0.5px;
}

.edit-input, .edit-form select {
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 9px 12px;
  color: #333;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.edit-input:focus, .edit-form select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

.edit-input::placeholder { color: #bbb; }

/* Force dark text on all edit card inputs */
.edit-card input,
.edit-card select,
.edit-card textarea {
  color: #333 !important;
}

/* Icon area in edit card */
.edit-card .icon-preview-row {
  display: flex; align-items: center; gap: 8px;
}

.edit-card .icon-preview {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
  overflow: hidden; flex-shrink: 0;
}

.edit-card .icon-actions {
  display: flex; gap: 6px;
}

.edit-card .btn-icon-action {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  color: #666; font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.edit-card .btn-icon-action:hover {
  background: rgba(99,102,241,0.06);
  color: var(--accent);
  border-color: var(--accent);
}

.edit-card .btn-icon-action svg { pointer-events: none; }

.edit-card .icon-text-input {
  width: 56px !important;
  flex: none;
  padding: 6px 8px;
  font-size: 13px;
  text-align: center;
}

.edit-card .icon-color-input {
  width: 32px; height: 32px;
  border: 2px solid rgba(0,0,0,0.08);
  border-radius: 50%;
  background: none; cursor: pointer;
  padding: 2px; flex-shrink: 0;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.edit-card .icon-color-input:hover {
  border-color: rgba(0,0,0,0.2);
  transform: scale(1.1);
}

.edit-card .icon-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.edit-card .icon-color-input::-webkit-color-swatch {
  border: none; border-radius: 50%;
}

.edit-card .icon-config input[type="text"] { flex: 1; }

.edit-card .icon-config input[type="color"] {
  width: 42px; height: 40px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  background: none; cursor: pointer; padding: 3px;
}

/* Icon Picker in edit card */
.edit-card .icon-picker {
  margin-bottom: 8px;
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  padding: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.edit-card .icon-picker::-webkit-scrollbar { width: 3px; }
.edit-card .icon-picker::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1); border-radius: 2px;
}

.edit-card .icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
}

.edit-card .icon-picker-item {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: rgba(0,0,0,0.03);
  border: 1.5px solid transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  overflow: hidden;
}

.edit-card .icon-picker-item:hover {
  border-color: var(--accent);
  background: rgba(99,102,241,0.08);
  transform: scale(1.08);
}

.edit-card .icon-picker-item img {
  width: 26px; height: 26px; object-fit: contain;
}

/* Actions row */
.edit-actions {
  display: flex; gap: 10px;
  margin-top: 6px;
}

.edit-actions .btn-primary {
  flex: 1;
  padding: 11px;
  font-size: 14px;
}

.edit-card .btn-delete-bm {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  padding: 11px 14px;
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px;
  background: rgba(239,68,68,0.04);
  color: var(--danger);
  font-size: 13px; font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex: none;
}

.edit-card .btn-delete-bm:hover {
  background: var(--danger); color: #fff;
  border-color: var(--danger);
}

.edit-card .btn-delete-bm svg { pointer-events: none; }

.btn-primary {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

/* ===== User Menu ===== */
.user-menu {
  position: fixed; top: 60px; right: 30px;
  padding: 8px;
  min-width: 180px;
  z-index: 500;
  animation: fadeInDown 0.2s ease;
}

.user-menu-item {
  display: block; width: 100%;
  background: none; border: none;
  color: var(--text-secondary);
  padding: 10px 14px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
}

.user-menu-item:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.user-menu hr {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 4px 0;
}

/* ===== Wallpaper Panel ===== */
.wallpaper-panel {
  width: min(600px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
}

.wallpaper-panel h3 { margin-bottom: 16px; }
.wallpaper-panel h4 {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 12px;
}

.wp-section { margin-bottom: 20px; }

.wp-upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 10px 20px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.wp-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.wp-thumb {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: var(--radius-xs);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.wp-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.03);
}

.wp-thumb.active { border-color: var(--accent); }

.wp-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.wp-thumb-del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff; border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
}

.wp-thumb:hover .wp-thumb-del { display: flex; }

/* ===== Icon Config ===== */
.icon-config {
  display: flex; gap: 10px; align-items: center;
}

.icon-config input[type="text"] {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
}

.icon-config input[type="color"] {
  width: 48px; height: 44px;
  border: none; border-radius: var(--radius-xs);
  cursor: pointer;
  background: none;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30,30,40,0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 24px;
  color: var(--text-primary);
  font-size: 14px;
  z-index: 9999;
  transition: transform 0.4s var(--bounce), opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Tools Dock ===== */
.tools-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 8px 16px;
  z-index: 300;
  animation: dockIn 0.5s var(--bounce);
}

@keyframes dockIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tool-dock-btn {
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 12px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-dock-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: scale(1.15);
}

.tool-dock-btn.active {
  background: rgba(99,102,241,0.2);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .clock-time { font-size: 36px; }
  .top-bar { padding: 12px 16px; }
  .top-actions { gap: 6px; }
  .glass-btn { padding: 6px 10px; font-size: 13px; }
  .search-wrapper { margin-top: 90px; }
  .nav-container { padding: 0 12px 100px; }
  .bookmark-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 12px; }
  .bookmark-icon { width: 38px; height: 38px; }
}

/* ===== Glass Select ===== */
.glass-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.glass-select option {
  background: #1e1e28;
  color: #fff;
}
