/* Theme Styles */

/* Light Theme */
body[data-theme="light"] {
  --text-color: #1a1a1a;
  --bg-color: #ffffff;
  --bookmark-bg: #f5f5f5;
  --bookmark-inner-bg: #ffffff;
  --bookmark-text: #1a1a1a;
  --bookmark-border: #e0e0e0;
  --ui-bg: #ffffff;
  --ui-text: #1a1a1a;
  --group-active-color: #1a1a1a;
  --group-inactive-color: #666666;
  --group-highlight-color: #4a9eff;

  /* Light Theme Overrides */
  --text-secondary: rgba(0, 0, 0, 0.7);
  --text-muted: rgba(0, 0, 0, 0.5);
  --text-placeholder: rgba(0, 0, 0, 0.4);
  --bg-secondary: rgba(0, 0, 0, 0.05);
  --bg-tertiary: rgba(0, 0, 0, 0.03);
  --border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .preferences-sidebar {
  background: rgba(255, 255, 255, 0.95);
  border-right-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .icon-btn {
  background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .icon-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .add-dropdown-menu {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .add-menu-item {
  color: var(--text-color, #1a1a1a);
}

body[data-theme="light"] .add-menu-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .search-input {
  background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .search-input.active {
  background: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .modal {
  background: rgba(0, 0, 0, 0.5);
}

body[data-theme="light"] .modal-content {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .pref-section {
  background: rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .pref-section-header {
  background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .pref-section-header:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Dark Theme (default styles already applied) */
body[data-theme="dark"] {
  --text-color: #ffffff;
  --bg-color: #1a1a1a;
  --bookmark-bg: #2a2a2a;
  --bookmark-inner-bg: #0000000d;
  --bookmark-text: #ffffff;
  --bookmark-border: #444444;
  --ui-bg: #1a1a1a;
  --ui-text: #ffffff;
  --group-active-color: #ffffff;
  --group-inactive-color: #888888;
  --group-highlight-color: #4a9eff;
}

/* Invert icons in dark mode to make them white */
body[data-theme="dark"] .icon,
body[data-theme="dark"] .icon-btn img,
body[data-theme="dark"] .theme-btn img,
body[data-theme="dark"] .edit-icon img,
body[data-theme="dark"] .thumbnail-option img,
body[data-theme="dark"] .add-menu-item .menu-icon {
  filter: invert(1);
}

/* Custom Background */
body[data-has-bg="true"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: var(--bg-size, cover);
  background-position: var(--bg-position, center);
  background-repeat: var(--bg-repeat, no-repeat);
  opacity: var(--bg-opacity, 1);
  z-index: -1;
}

/* Glassmorphism effect when background is set */
body[data-has-bg="true"] .bookmark-tile,
body[data-has-bg="true"] .preferences-sidebar,
body[data-has-bg="true"] .modal-content {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}