:root {
  --primary-color: #6c63ff;
  --primary-hover: #5a52d5;
  --accent-color: #00e5ff;
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --success-color: #00c853;
  --danger-color: #ff5252;
  --glass-bg: rgba(30, 30, 30, 0.9);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.2);
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-family: "Outfit", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  /* Prevent body scroll, handle in main */
}

/* Dynamic Background */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%,
      rgba(108, 99, 255, 0.15) 0%,
      transparent 40%),
    radial-gradient(circle at 90% 80%,
      rgba(0, 229, 255, 0.1) 0%,
      transparent 40%);
  z-index: -1;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  /* Dynamic Viewport Height for mobile */
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Header */
.app-header {
  padding: 20px 20px 10px;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

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

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}


/* Logo & Menu */
.logo-container {
  position: relative;
  display: flex;
  align-items: center;
}

.logo-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: block;
  transition: transform 0.2s ease;
}

.logo-btn:active {
  transform: scale(0.95);
}

.logo-btn img {
  height: 30px;
  width: auto;
  display: block;
  /* filter: brightness(0) invert(1); */
  /* Make it match text-secondary (#b0b0b0 approx 0.7) */
  filter: brightness(0) invert(0.7);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  z-index: 1000;
  overflow: hidden;
  animation: menuFadeIn 0.2s ease-out;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item svg {
  opacity: 0.8;
}

.text-danger {
  color: var(--danger-color);
}

.text-danger svg {
  color: var(--danger-color);
}


.connection-status {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  margin-right: 6px;
  transition: background-color 0.3s ease;
}

.status-dot.online {
  background-color: var(--success-color);
  box-shadow: 0 0 8px var(--success-color);
}

.status-dot.offline {
  background-color: var(--danger-color);
}

.status-dot.syncing {
  background-color: var(--accent-color);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Main List */
.list-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 100px;
  /* Space for input area */
}

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

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-btn-header {
  margin-left: auto;
  /* Just in case, though space-between handles it if direct child */
}

h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 10px;
}

.count-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.section-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sort-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  font-style: italic;
}

.search-btn-header {
  background: rgba(255, 255, 255, 0.05);
  width: 36px;
  height: 36px;
  padding: 8px;
}

.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.list-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.list-item:active {
  transform: scale(0.98);
}

.list-item.selected {
  border-color: var(--primary-color);
  background: rgba(108, 99, 255, 0.1);
}

.item-content {
  flex: 1;
  display: flex;
  align-items: center;
  /* gap: 7px; Removed as emoji is outside now */
  cursor: pointer;
}

.item-emoji {
  font-size: 22px;
  margin-right: 12px;
  line-height: 1;
}

.item-text {
  font-size: 16px;
  font-weight: 400;
}

.item-text {
  text-transform: capitalize;
}

.list-item.completed .item-text {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.pending-icon {
  font-size: 12px;
  opacity: 0.7;
}

.item-left {
  flex: 1;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding-right: 12px;
  /* Space before separator */
}

.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-left: 12px;
  border-left: 1px solid var(--glass-border);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

#group-btn.active {
  background: rgba(108, 99, 255, 0.2);
  color: var(--primary-color);
}

#smart-sort-btn.active {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
}

.delete-btn {
  color: var(--danger-color);
  opacity: 0.7;
}

.delete-btn:hover {
  opacity: 1;
  background: rgba(255, 82, 82, 0.1);
}

.icon-btn.disabled,
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Completed Section */
#completed-items-section {
  margin-top: 30px;
}

.toggle-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 15px;
}

.toggle-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chevron {
  transition: transform 0.3s ease;
}

.toggle-btn.collapsed .chevron {
  transform: rotate(-90deg);
}

.hidden {
  display: none !important;
}

/* Input Area */
.input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  /* Mobile safe area */
  background: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid var(--glass-border);
  z-index: 100;
  /* Ensure it's above list content */
}

#add-item-form {
  display: flex;
  gap: 10px;
}

#new-item-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

#new-item-input:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.15);
}

.primary-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
  transition: transform 0.2s, background-color 0.2s;
}

.primary-btn:active {
  transform: scale(0.95);
}

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

/* Sync Badge */
.sync-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background-color: var(--success-color);
  border-radius: 50%;
  border: 2px solid var(--bg-color);
}

/* Edit Mode */
.edit-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--primary-color);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  width: 100%;
  padding: 4px 0;
  outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

@media (min-width: 600px) {
  .app-container {
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
  }
}

/* Locked State */
.lock-icon {
  display: none;
}

.list-container.locked .list-item {
  pointer-events: none;
  opacity: 0.9;
  /* Less dim to see the red icon better */
}

.list-container.locked .list-item .icon-btn {
  display: none;
}

.list-container.locked .list-item .lock-icon {
  display: flex;
  color: var(--danger-color);
  padding: 4px;
}

#lock-btn.active {
  color: var(--accent-color);
  background: rgba(0, 229, 255, 0.1);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

.loading-logo {
  height: 60px;
  width: auto;
  filter: brightness(0) invert(0.7);
  animation: logoFloat 2s ease-in-out infinite;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Modal Overlay (Generic) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-box {
  padding: 30px;
  width: 90%;
  max-width: 370px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--shadow-md);
  transform: scale(1);
  transition: transform 0.2s ease;
}

.modal-overlay.hidden .modal-box {
  transform: scale(0.95);
}

.modal-box h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal-box p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-actions button {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.modal-actions .primary-btn {
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: none;
  /* Optional: remove shadow in modal if desired, or keep */
  padding: 12px 24px;
  font-size: 16px;
}

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

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.danger-btn {
  background: var(--danger-color);
  color: white;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
}

.danger-btn:hover {
  background: #ff1744;
  /* Darker red or lighter? Adjusted manually */
  transform: translateY(-1px);
}

.login-box {
  padding: 40px;
  width: 90%;
  max-width: 320px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--shadow-md);
}

.login-box h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.login-box p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  text-align: center;
}

.login-box input:focus {
  border-color: var(--primary-color);
}

.full-width {
  width: 100%;
  border-radius: var(--radius-md);
}

.error-text {
  color: var(--danger-color);
  margin-top: 15px;
  font-size: 14px;
}

.error-text.hidden {
  display: none;
}

/* Item Date */
.item-dates {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}

.item-date {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.item-date svg {
  opacity: 0.7;
}

/* Item Category Label */
.item-category {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.3px;
  margin-left: auto;
}

/* Hide categories when setting is disabled */
.list-container.hide-categories .item-category {
  display: none !important;
}

/* Item Details Wrapper */
.item-details {
  display: flex;
  flex-direction: column;
  flex: 1;
}

#wakelock-btn.active {
  color: var(--accent-color);
  background: rgba(0, 229, 255, 0.1);
}

/* Shop Badge */
.item-shop-badge {
  font-size: 11px;
  background: rgba(108, 99, 255, 0.2);
  color: #a0a0ff;
  padding: 2px 2px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Edit Container */
.edit-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.edit-shop-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  max-width: 120px;
}

.edit-shop-select option {
  background: #2a2a2a;
  color: white;
}

.save-btn {
  color: var(--success-color);
  padding: 4px;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  /* background: var(--glass-bg); removed as it's inside header which has background */
  margin-top: 10px;
  margin-bottom: 10px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shop Manager */
.shops-box {
  width: 90%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.shops-list {
  flex: 1;
  overflow-y: auto;
  margin: 15px 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}

.shop-entry {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

.shop-entry:last-child {
  border-bottom: none;
}

.shop-entry:hover {
  background: rgba(255, 255, 255, 0.05);
}

.shop-entry-name {
  font-weight: 500;
  min-width: 50%;
}

.shop-entry-name small {
  display: block;

}

.shop-entry-aliases {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.shop-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.shop-add-btn {
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid var(--primary-color);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.shop-add-btn:hover {
  background: var(--primary-color);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
  transform: translateY(-1px);
}

/* Shop Edit Form */
.shop-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 15px 0;
}

.shop-edit-form label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: -8px;
}

.shop-edit-form input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  padding: 8px;
  border-radius: var(--radius-sm);
  color: #fff;
}

.aliases-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}

.alias-chip {
  background: rgba(108, 99, 255, 0.2);
  border: 1px solid rgba(108, 99, 255, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.alias-remove {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.7;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
}

.alias-remove:hover {
  opacity: 1;
  color: var(--danger-color);
}

.add-alias-row {
  display: flex;
  gap: 8px;
}

.add-alias-row input {
  flex: 1;
}

.search-bar.hidden {
  display: none !important;
}

#search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

#search-input:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.15);
}

.icon-btn.small {
  padding: 4px;
  width: 32px;
  height: 32px;
}

#search-toggle-btn.active,
#filter-toggle-btn.active {
  color: var(--primary-color);
  background: rgba(108, 99, 255, 0.1);
}

.save-btn:hover {
  background: rgba(0, 200, 83, 0.1);
}

/* Shop Group Header */
.shop-group-header {
  background-color: var(--bg-secondary);
  color: var(--accent-color);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

/* Drag and Drop */
.drag-handle {
  cursor: grab;
  padding: 0 8px;
  /* Adjust padding */
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  /* Prevent scrolling while dragging */
}

.drag-handle svg {
  width: 20px;
  height: 20px;
}

@media (pointer: coarse) {
  .drag-handle {
    display: none;
  }
}

/* Drag & Drop */
.drag-handle {
  cursor: grab;
  touch-action: none;
  padding: 8px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.drag-handle:active {
  cursor: grabbing;
}

.list-item.dragging-hidden {
  display: none;
  /* Hide original item while dragging */
}

/* Placeholder Style */
.drag-placeholder {
  background: rgba(108, 99, 255, 0.1);
  border: 2px dashed var(--primary-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  /* animation: pulse 1s infinite; */
  box-sizing: border-box;
  pointer-events: none;
}

.list-item {
  transition: all 0.2s ease;
  position: relative;
}

/* Mobile Drag Ghost */

/* Mobile Drag Ghost */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0.95;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  border: 1px solid var(--primary-color);
}

#group-btn.active {
  color: var(--accent-color);
  background: rgba(0, 229, 255, 0.1);
}

/* Settings Modal */
.settings-box {
  min-width: 300px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  user-select: none;
}

.setting-item input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  transition: background 0.3s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-item input:checked+.toggle-switch {
  background: var(--success-color);
}

.setting-item input:checked+.toggle-switch::after {
  transform: translateX(20px);
}


#settings-close {
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
}

.menu-version-info {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 8px 16px;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  margin-top: 5px;
  opacity: 0.7;
}

/* Shop Filter */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: slideDown 0.2s ease-out;
  border-radius: 10px;
  margin-bottom: 6px;
}

.filter-bar.hidden {
  display: none;
}

.shop-filter-btn {
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shop-filter-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.shop-filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Shop Filter Reset Button */
.shop-filter-btn[data-action="reset"] {
  border-color: rgba(255, 255, 255, 0.2);
  /* Separator gap */
  position: relative;
}

.shop-filter-btn[data-action="reset"]::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.shop-filter-btn[data-action="reset"].active {
  background: var(--accent-color, #00e5ff);
  /* Fallback to cyan if var missing */
  border-color: var(--accent-color, #00e5ff);
  color: #121212;
  /* Dark text for contrast on bright accent */
  font-weight: 600;
}

/* Header Grouping */
.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Consistent gap between buttons */
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5000;
  width: 90%;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastSlideUp 0.3s ease-out;
  pointer-events: auto;
}

.toast.toast-error {
  border-left: 4px solid var(--danger-color);
}

.toast.toast-info {
  border-left: 4px solid var(--primary-color);
}

.toast.toast-warning {
  border-left: 4px solid var(--accent-color);
}

.toast.fade-out {
  animation: toastFadeOut 0.3s ease-in forwards;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastFadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Voice Input UI */
.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  padding-right: 40px !important;
}

.voice-btn {
  position: absolute;
  right: 5px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  cursor: pointer;
  display: flex;
  transition: all 0.3s ease;
  z-index: 5;
}

.voice-btn:hover {
  color: var(--text-primary);
  background: transparent;
  transform: scale(1.1);
}

.voice-btn.listening {
  color: var(--danger-color);
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}