/* assets/css/components.css
 * Grid tiles, bookmark squircles, 2x2 folders, floating dock, popovers, and Adwaita modals.
 */

/* Grid Tile */
.grid-tile {
  width: 96px;
  padding: 12px 8px 10px 8px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition:
    background-color 0.16s ease,
    transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1),
    opacity 0.15s ease;
}

@media (min-width: 640px) {
  .grid-tile {
    width: 112px;
  }
}

.grid-tile:hover {
  background-color: rgba(255, 255, 255, 0.11);
}

.grid-tile:active {
  transform: scale(0.95);
}

.grid-tile.dragging {
  opacity: 0.42;
  transform: scale(0.92);
}

.grid-tile.drag-over-merge {
  background-color: rgba(53, 132, 228, 0.32) !important;
  box-shadow: 0 0 0 2px var(--gnome-accent);
  transform: scale(1.06);
}

.grid-tile.drag-over-reorder-left::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 16%;
  bottom: 16%;
  width: 3px;
  border-radius: 99px;
  background: var(--gnome-accent);
  box-shadow: 0 0 8px var(--gnome-accent);
}

.tile-icon-holder {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-label {
  width: 100%;
  padding: 0 4px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Bookmark Squircle */
.bookmark-squircle {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.grid-tile:hover .bookmark-squircle {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.36);
}

.squircle-favicon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.squircle-letter {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* GNOME 2x2 Folder Squircle */
.folder-squircle {
  width: 76px;
  height: 76px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.grid-tile:hover .folder-squircle {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
}

.mini-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.mini-icon .squircle-favicon {
  width: 16px;
  height: 16px;
}

.mini-icon .squircle-letter {
  font-size: 11px;
}

/* Floating Bottom Dock */
.dock-footer {
  position: relative;
  z-index: 20;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 16px 14px 16px;
  flex-shrink: 0;
}

.gnome-dock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  max-width: 100%;
  background: rgba(28, 28, 32, 0.74);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-pinned-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock-separator {
  width: 1px;
  height: 32px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.dock-item {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-item:hover {
  transform: translate3d(0, -5px, 0) scale(1.08);
  background-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.dock-item:active {
  transform: translate3d(0, -1px, 0) scale(0.96);
  transition-duration: 0.12s;
}

.dock-action-btn {
  background-color: rgba(255, 255, 255, 0.1);
}

.dock-action-bookmark:hover {
  background-color: rgba(53, 132, 228, 0.32);
}

.dock-action-folder:hover {
  background-color: rgba(245, 194, 17, 0.28);
}

.dock-icon-squircle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.dock-icon-squircle .squircle-favicon {
  width: 24px;
  height: 24px;
}

.dock-icon-squircle .squircle-letter {
  font-size: 18px;
}

.dock-tooltip {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translate3d(-50%, 6px, 0) scale(0.96);
  background: rgba(18, 18, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 60;
  transition:
    opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translate3d(-50%, 0, 0) scale(1);
}

/* Popovers & Dropdown Menus */
.gnome-popover {
  background: rgba(36, 36, 40, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.52);
}

.workspace-popover {
  position: absolute;
  left: 0;
  top: 36px;
  width: 256px;
  padding: 8px;
  z-index: 50;
}

.appearance-popover {
  position: absolute;
  right: 40px;
  top: 36px;
  width: 288px;
  padding: 10px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.system-popover {
  position: absolute;
  right: 0;
  top: 36px;
  width: 300px;
  padding: 8px;
  z-index: 50;
}

.user-popover {
  position: absolute;
  right: 0;
  top: 36px;
  width: 240px;
  padding: 8px;
  z-index: 50;
}

.context-menu {
  position: fixed;
  width: 208px;
  padding: 6px;
  z-index: 50;
}

.popover-header {
  padding: 6px 12px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popover-header-row {
  padding: 6px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popover-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.55);
}

.popover-badge {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.popover-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.popover-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}

.workspace-menu-list {
  max-height: 224px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-row {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.menu-row:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.menu-row.disabled {
  opacity: 0.42;
  cursor: default;
}

.menu-row.disabled:hover {
  background-color: transparent;
}

.menu-row.active-ws {
  background-color: rgba(255, 255, 255, 0.15);
  font-weight: 600;
  color: #ffffff;
}

.menu-row-between {
  justify-content: space-between;
}

.menu-row-accent {
  color: #99c1f1;
  font-weight: 500;
}

.menu-row.danger:hover {
  background-color: rgba(224, 27, 36, 0.25);
  color: #ff7b7b;
}

.menu-divider {
  margin: 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Appearance Controls Box */
.wallpaper-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallpaper-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wallpaper-box-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.wallpaper-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wallpaper-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-input {
  flex: 1;
  min-width: 0;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px;
  outline: none;
}

.mini-input:focus {
  border-color: var(--gnome-accent);
}

.blur-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.blur-value {
  font-weight: 600;
  color: #ffffff;
}

/* Folder Modal Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.folder-backdrop {
  z-index: 30;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-backdrop {
  z-index: 50;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-backdrop-dark {
  z-index: 50;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.folder-modal-card {
  width: 100%;
  max-width: 576px;
  padding: 24px 32px;
  background: rgba(46, 46, 50, 0.78);
  backdrop-filter: blur(32px) saturate(1.2);
  -webkit-backdrop-filter: blur(32px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: folderPopIn 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.15);
}

@keyframes folderPopIn {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.folder-modal-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.folder-header-side {
  width: 72px;
  display: flex;
  align-items: center;
}

.folder-header-right {
  justify-content: flex-end;
}

.folder-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.folder-title-input {
  width: 100%;
  max-width: 280px;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.folder-title-input:hover {
  background: rgba(255, 255, 255, 0.1);
}

.folder-title-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(53, 132, 228, 0.7);
}

.folder-bookmarks-grid {
  width: 100%;
  max-height: 52vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  justify-items: center;
  padding: 8px 0;
}

@media (min-width: 640px) {
  .folder-bookmarks-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.folder-empty-msg {
  grid-column: 1 / -1;
  padding: 32px 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.folder-modal-tip {
  margin: 20px 0 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

/* Dialog Cards & Forms */
.dialog-card {
  width: 100%;
  padding: 24px;
}

.dialog-md { max-width: 448px; }
.dialog-sm { max-width: 384px; }

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

.dialog-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 6px;
}

.form-hint {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.form-hint:empty {
  display: none;
}

#acct-email-verify-link:empty {
  display: none;
}

.label-hint {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
}

.adwaita-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.adwaita-input:focus {
  border-color: var(--gnome-accent);
  box-shadow: 0 0 0 2px rgba(53, 132, 228, 0.35);
}

.adwaita-input option {
  background-color: #2b2b2f;
  color: #ffffff;
}

.icon-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-preview-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gnome-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  font-weight: 700;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
}

.color-input {
  width: 40px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.color-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.confirm-message {
  margin: 8px 0 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.dialog-actions-center {
  justify-content: center;
  margin-top: 16px;
}

/* Buttons */
.btn-pill-primary,
.btn-pill-secondary,
.btn-pill-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-pill-primary {
  background: var(--gnome-accent);
  box-shadow: 0 4px 14px rgba(53, 132, 228, 0.35);
}

.btn-pill-primary:hover {
  background: var(--gnome-accent-hover);
}

.btn-pill-secondary {
  background: rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

.btn-pill-secondary:hover {
  background: rgba(255, 255, 255, 0.17);
}

.btn-pill-danger {
  background: var(--gnome-danger);
}

.btn-pill-danger:hover {
  background: var(--gnome-danger-hover);
}

.btn-sm {
  padding: 6px 12px;
}

.btn-xs {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
}

.btn-icon-close,
.btn-icon-danger,
.btn-icon-mini {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-icon-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-icon-danger {
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon-danger:hover {
  background: rgba(224, 27, 36, 0.3);
  color: #fecaca;
}

.btn-icon-mini {
  padding: 4px;
  border-radius: 6px;
}

.btn-icon-mini:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.btn-icon-mini.danger:hover {
  background: rgba(224, 27, 36, 0.32);
  color: #fca5a5;
}

/* Toast Notification */
.toast-pill {
  position: fixed;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}