/* CSS Design System & Style Tokens for LinkDeck (Pixel-Perfect to Screenshot) */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Inter', -apple-system, sans-serif;
  
  /* Very soft, premium light blue-grey gradient as seen in screenshot */
  --bg-mesh-gradient: linear-gradient(180deg, #e8f5ff 0%, #d8edfe 50%, #e5f2ff 100%);
  
  --color-primary: #1e293b;
  --color-secondary: #64748b;
  --color-accent: #1e293b;
  
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.08);
  --glass-blur: blur(20px);
  
  /* Clean, rounded white cards exactly like the screenshot */
  --card-bg: #ffffff;
  --card-bg-hover: #ffffff;
  --card-border: rgba(255, 255, 255, 0.8);
  --card-shadow: 0 4px 12px rgba(148, 163, 184, 0.12);
  
  --text-main: #334155;
  --text-muted: #64748b;
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  
  /* Sizing and Scaling custom properties */
  --tile-scale: 1.0;
  --grid-columns: 7;
  --grid-rows: 5;
  --grid-dot-color: rgba(0, 0, 0, 0.07);
  --grid-cell-border: rgba(30, 41, 59, 0.15); /* Significantly bolder, slate-blue tinted border for amazing contrast */
  --grid-cell-bg: rgba(30, 41, 59, 0.02); /* Bolder cell shading */
  --content-scale: 1.0; /* Content scale (Icons & Font Size) completely decoupled from backing size! */
  --tile-padding: calc(0.75rem * var(--tile-scale));
  --tile-font-size: calc(0.78rem * var(--content-scale));
  --tile-domain-size: calc(0.66rem * var(--content-scale));
  --grid-gap: calc(12px * var(--tile-scale));
  --logo-scale: 1.3;
  --clock-scale: 1.0;
  --search-scale: 1.0;
  --tabs-scale: 1.0;
}

/* Dark Mode Overrides (if chosen in settings) */
[data-theme="dark"] {
  --color-primary: #f8fafc;
  --color-secondary: #94a3b8;
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-bg-hover: rgba(30, 41, 59, 0.9);
  --card-border: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --grid-dot-color: rgba(255, 255, 255, 0.12);
  --grid-cell-border: rgba(255, 255, 255, 0.28); /* Significantly bolder white glow borders */
  --grid-cell-bg: rgba(255, 255, 255, 0.04); /* Deeper background boxes for dark theme dark backgrounds */
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: #f1f5f9;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: var(--transition-smooth);
}

/* Background Gradients */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-mesh-gradient);
  z-index: -2;
  transition: background 0.8s ease-in-out;
}

.bg-mesh.has-custom-img {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4) 0%, rgba(216, 237, 254, 0.1) 100%);
  z-index: -1;
  pointer-events: none;
}

/* Main Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 2rem 3rem 6rem 3rem;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Logo "🚀 LinkDeck" Top-Left Position */
.app-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  min-height: 80px;
}

/* Absolute top-left logo */
.brand-logo-container {
  position: absolute;
  left: 0;
  top: 4px; /* Balanced top offset for the larger logo */
  display: flex;
  align-items: center;
  gap: calc(16px * var(--logo-scale));
  user-select: none;
  transform-origin: left center;
  transition: var(--transition-smooth);
}

.brand-logo-emoji {
  font-size: calc(2.4rem * var(--logo-scale)); /* Doubled from 1.2rem */
  display: inline-block;
  line-height: 1;
  transition: var(--transition-smooth);
}

.brand-logo-img {
  width: calc(40px * var(--logo-scale)); /* Doubled from 20px */
  height: calc(40px * var(--logo-scale)); /* Doubled from 20px */
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-main);
  font-size: calc(2.4rem * var(--logo-scale)); /* Doubled from 1.2rem */
  font-weight: 800;
  color: #1d4ed8; /* Blue brand color */
  letter-spacing: -0.02em;
  transition: var(--transition-smooth);
}

.brand-subtitle {
  font-size: calc(0.7rem * var(--logo-scale)); /* Doubled from 0.35rem */
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: calc(-2px * var(--logo-scale));
  display: block;
  font-family: var(--font-main);
  transition: var(--transition-smooth);
}

/* Clock in Header */
.clock-widget {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  transition: var(--transition-smooth);
}

.clock-time {
  font-family: var(--font-display);
  font-size: calc(3.5rem * var(--clock-scale));
  font-weight: 500;
  color: #1e293b;
  line-height: 1.1;
  letter-spacing: -0.01em;
  transition: var(--transition-smooth);
}

.clock-date {
  font-family: var(--font-main);
  font-size: calc(0.75rem * var(--clock-scale));
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  text-transform: uppercase;
  margin-top: calc(0.2rem * var(--clock-scale));
  transition: var(--transition-smooth);
}

/* Search Bar Styles */
.search-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: calc(550px * var(--search-scale)); /* Increased 30% from 420px */
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(148, 163, 184, 0.08);
  padding: 0 calc(1.6rem * var(--search-scale)); /* Scaled padding */
  height: calc(54px * var(--search-scale)); /* Increased 30% from 422px */
  transition: var(--transition-smooth);
}

.search-wrapper:focus-within {
  background: #ffffff;
  box-shadow: 0 6px 24px rgba(148, 163, 184, 0.15);
}

/* Search icon on the right as seen in screenshot */
.search-icon {
  width: calc(1.3rem * var(--search-scale)); /* Scaled icon width */
  height: calc(1.3rem * var(--search-scale)); /* Scaled icon height */
  color: #3b82f6;
  order: 2; /* Pushes to the right */
  margin-left: auto;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

#search-input {
  width: 100%;
  padding: calc(0.8rem * var(--search-scale)) 0;
  background: none;
  border: none;
  outline: none;
  color: #1e293b;
  font-family: var(--font-main);
  font-size: calc(1.1rem * var(--search-scale)); /* Increased 30% from 0.85rem */
  font-weight: 500;
  order: 1; /* Input on the left */
  text-align: center; /* Centered placeholder & input text */
  transition: var(--transition-smooth);
}

#search-input::placeholder {
  color: #94a3b8;
  opacity: 0.9;
}

.search-clear-btn {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  order: 3;
  margin-left: 4px;
  transition: var(--transition-fast);
}

/* Workspaces Tabs Style */
.workspaces-nav {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.workspaces-tabs {
  display: flex;
  gap: 1.15rem; /* Increased 1.5x for larger tabs layout spacing */
  background: transparent;
  padding: 6px;
  border-radius: 50px;
  overflow-x: auto;
}

.workspace-tab {
  background: none;
  border: 1px solid transparent;
  outline: none;
  padding: calc(0.75rem * var(--tabs-scale)) calc(1.85rem * var(--tabs-scale)); /* Increased 1.5x padding */
  border-radius: 50px;
  color: #64748b;
  font-family: var(--font-main);
  font-size: calc(1.425rem * var(--tabs-scale)); /* Increased 1.5x from 0.95rem for premium readability */
  font-weight: 700; /* Extra crisp font weight */
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.workspace-tab:hover {
  color: #1e293b;
}

/* Active Tab exactly like screenshot: White rounded button with a thin dark/grey border */
.workspace-tab.active {
  color: #0f172a;
  background: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 8px rgba(148, 163, 184, 0.05);
}

/* Bookmarks Grid (Standard 10 Columns or auto-fill) */
.bookmarks-section {
  flex-grow: 1;
}

.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), calc(155px * var(--tile-scale))); /* Absolute size per column */
  grid-template-rows: repeat(var(--grid-rows), calc(115px * var(--tile-scale))); /* Explicit rows height grid matching desktop */
  justify-content: center; /* Centered layout */
  gap: var(--grid-gap);
  width: 100%;
  min-height: 550px;
  position: relative;
  border-radius: 16px;
  padding: 10px;
  transition: var(--transition-smooth);
}

.grid-cell-placeholder {
  border: 2px dashed var(--grid-cell-border, rgba(30, 41, 59, 0.15));
  background: var(--grid-cell-bg, rgba(30, 41, 59, 0.02));
  border-radius: 18px;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  transition: var(--transition-smooth);
}

/* Bookmarks Tile Core Layout */
.bookmark-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px; /* Organic soft rounded corners matching screenshot */
  padding: calc(1rem * var(--tile-scale));
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centered items vertically for balanced spacing */
  align-items: center;
  text-decoration: none;
  color: #334155;
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  user-select: none;
  overflow: hidden;
  aspect-ratio: 1.35 / 1; /* Beautiful horizontal rounded rectangles */
  gap: calc(10px * var(--tile-scale)); /* Clean spacing between icon and text */
}

/* Tile Custom layouts & Sizes */
.bookmark-tile.size-small {
  grid-column: span 1;
  grid-row: span 1;
  aspect-ratio: 1.35 / 1;
}

/* Sizing templates logic as tiles */
.bookmark-tile.size-medium {
  grid-column: span 1; /* Standard columns spans 1 as seen in screenshot grid */
  grid-row: span 1;
}

.bookmark-tile.size-large {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: 1.35 / 1;
}

.bookmark-tile.size-wide {
  grid-column: span 2;
  grid-row: span 1;
  aspect-ratio: 2.7 / 1;
  flex-direction: row !important;
  justify-content: flex-start;
  gap: 12px;
}

.bookmark-tile.size-tall {
  grid-column: span 1;
  grid-row: span 2;
  aspect-ratio: 1.35 / 2;
}

/* Hover effects */
.bookmark-tile:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.2);
  border-color: rgba(0, 0, 0, 0.05);
}

/* Brand Colored tiles support */
.bookmark-tile.brand-colored {
  border: none;
}

.bookmark-tile.brand-colored .bookmark-title {
  color: #ffffff !important;
}

.bookmark-tile.brand-colored .bookmark-domain {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Tile Icon Styles - White Squircle Container precisely like screenshot */
.bookmark-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px; /* Perfect squircle radius */
  background: #ffffff; /* Always crisp white background */
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06); /* Premium soft drop shadow */
  width: calc(46px * var(--content-scale));
  height: calc(46px * var(--content-scale));
  padding: calc(6px * var(--content-scale));
  flex-shrink: 0;
  transition: var(--transition-smooth);
  margin-top: calc(-4px * var(--content-scale)); /* Elevate icon slightly for more text room below */
}

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

.bookmark-icon-container .icon-emoji {
  font-size: calc(22px * var(--content-scale));
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Icon Sizing Tokens (keep fallbacks) */
.icon-size-xs { width: calc(30px * var(--content-scale)); height: calc(30px * var(--content-scale)); padding: calc(4px * var(--content-scale)); }
.icon-size-xs .icon-emoji { font-size: calc(14px * var(--content-scale)); }

.icon-size-s  { width: calc(38px * var(--content-scale)); height: calc(38px * var(--content-scale)); padding: calc(5px * var(--content-scale)); }
.icon-size-s  .icon-emoji { font-size: calc(18px * var(--content-scale)); }

.icon-size-m  { width: calc(46px * var(--content-scale)); height: calc(46px * var(--content-scale)); padding: calc(6px * var(--content-scale)); }
.icon-size-m  .icon-emoji { font-size: calc(22px * var(--content-scale)); }

.icon-size-l  { width: calc(54px * var(--content-scale)); height: calc(54px * var(--content-scale)); padding: calc(8px * var(--content-scale)); }
.icon-size-l  .icon-emoji { font-size: calc(28px * var(--content-scale)); }

.icon-size-xl { width: calc(62px * var(--content-scale)); height: calc(62px * var(--content-scale)); padding: calc(10px * var(--content-scale)); }
.icon-size-xl .icon-emoji { font-size: calc(34px * var(--content-scale)); }

/* Tile Labels Styles */
.bookmark-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

.bookmark-title {
  font-size: var(--tile-font-size); /* Responsive typography */
  font-weight: 700;
  color: #1e293b;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Support up to exactly 2 lines of text */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

.bookmark-domain {
  font-size: var(--tile-domain-size);
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
  margin-top: 1px;
}

.bookmark-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  display: none; /* Only show in large sizes */
}

.size-large .bookmark-desc {
  display: block;
}

/* Edit indicator */
.bookmark-edit-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.05);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-fast);
  z-index: 5;
}

.bookmark-tile:hover .bookmark-edit-badge {
  opacity: 1;
}

.bookmark-edit-badge:hover {
  background: #1e293b;
  color: white;
}

.bookmark-edit-badge svg {
  width: 10px;
  height: 10px;
}

/* Custom Add Button Style */
.bookmark-tile.tile-adder {
  background: rgba(255, 255, 255, 0.3);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  color: #64748b;
}

.bookmark-tile.tile-adder:hover {
  background: #ffffff;
  border-color: #1d4ed8;
  color: #1e293b;
}

.adder-icon {
  width: 20px;
  height: 20px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Drag State stylings */
.bookmark-tile.dragging {
  opacity: 0.3;
  transform: scale(0.95);
}

.bookmark-tile.drag-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

/* Footer & Settings Trigger */
.app-footer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
}

.settings-trigger-btn {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.12);
  transition: var(--transition-smooth);
}

.settings-trigger-btn:hover {
  transform: rotate(45deg);
  color: #1e293b;
}

.settings-trigger-btn svg {
  width: 16px;
  height: 16px;
}

/* Modals & Overlay system */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
}

.modal-card-large {
  max-width: 720px;
  height: 80vh;
  max-height: 520px;
}

.modal-header {
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
}

/* Input Fields styling */
.form-group {
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #0f172a;
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-group input[type="text"]:focus {
  border-color: #3b82f6;
  background: #ffffff;
}

/* Selectors button list */
.size-selector {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.btn-size-choice {
  flex-grow: 1;
  background: none;
  border: none;
  outline: none;
  padding: 0.4rem 0;
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.btn-size-choice.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(148, 163, 184, 0.15);
}

/* Custom Palette Swatches */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}

.color-swatch.active {
  border-color: #3b82f6;
  transform: scale(1.1);
}

.custom-color-wrapper {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: relative;
  background-image: conic-gradient(red, yellow, green, cyan, blue, magenta, red);
  overflow: hidden;
}

.custom-color-wrapper input[type="color"] {
  position: absolute;
  opacity: 0;
}

/* System Action Buttons */
.btn-primary {
  background: #1e293b;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: #0f172a;
}

.btn-secondary {
  background: #f1f5f9;
  color: #ef4444;
  border: 1px solid #e2e8f0;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-text {
  background: none;
  border: none;
  padding: 0.55rem 1rem;
  color: #64748b;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

/* Settings Panel side navigation layout */
.settings-layout {
  display: flex;
}

.settings-sidebar {
  width: 180px;
  border-right: 1px solid #f1f5f9;
  padding-right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-item {
  background: none;
  border: none;
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: #64748b;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-item.active {
  color: #0f172a;
  background: #f1f5f9;
}

.settings-content {
  flex-grow: 1;
  padding-left: 1.25rem;
}

.settings-page {
  display: none;
}

.settings-page.active {
  display: block;
}

.settings-page h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.settings-group {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 2px 12px;
  margin-bottom: 1rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.settings-row:last-child {
  border-bottom: none;
}

.setting-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.setting-desc {
  font-size: 0.7rem;
  color: #64748b;
}

/* Toggle Switch slider */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border-radius: 20px;
  transition: .2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px; width: 14px;
  left: 3px; bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .2s;
}

input:checked + .slider { background-color: #3b82f6; }
input:checked + .slider:before { transform: translateX(16px); }

/* Wallpapers list */
.wallpapers-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.wallpaper-item {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  cursor: pointer;
}

.wallpaper-item.active {
  border: 2px solid #3b82f6;
}

/* Custom URL background apply */
.custom-url-wrapper {
  display: flex;
  gap: 6px;
}

/* Workspace management edit table rows */
.workspace-manager-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workspace-manager-row {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 6px 12px;
  gap: 8px;
}

.workspace-drag-handle { color: #94a3b8; cursor: grab; }
.workspace-drag-handle svg { width: 14px; height: 14px; }
.workspace-manager-input {
  flex-grow: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.workspace-manager-delete {
  background: none;
  border: none;
  color: #ff3366;
  cursor: pointer;
}

.workspace-manager-delete svg { width: 14px; height: 14px; }

.workspace-manager-row.dragging {
  opacity: 0.4;
  border-style: dashed;
  background: rgba(0, 0, 0, 0.02);
}

.workspace-manager-row.drag-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
  transform: translateY(1px);
}

/* Responsive Grid Adapters */
@media(max-width: 1100px) {
  .bookmarks-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media(max-width: 768px) {
  .app-container {
    padding: 1rem 1rem 4rem 1rem;
  }
  .brand-logo-container {
    position: relative;
    top: 0;
    margin-bottom: 1rem;
  }
  .app-header {
    flex-direction: column;
    min-height: auto;
  }
  .bookmarks-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .settings-layout {
    flex-direction: column;
  }
  .settings-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }
  .wallpapers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
