/* Base styles (scoped specifically to extension elements) */
.unicode-suggestion-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  z-index: 10000 !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px;
}

/* Compact version for small inputs */
.unicode-suggestion-btn.compact {
  width: 16px;
  height: 16px;
  right: 6px;
  bottom: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.viblify-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(45deg, #667eea, #764ba2);
  transition: all 0.2s ease;
}

.unicode-suggestion-btn.compact:hover .viblify-dot {
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

.unicode-suggestion-btn:hover {
  transform: scale(1.1);
}

.unicode-suggestion-btn.hidden {
  display: none;
}

.unicode-suggestion-popup {
  width: 256px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease-out;
  position: fixed;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 10000 !important;
}

.unicode-suggestion-popup.hidden {
  display: none;
}

.unicode-suggestion-popup .suggestion-options {
  max-height: 256px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 0 0 8px 8px;
}

.unicode-suggestion-popup .suggestion-options button {
  width: 100%;
  text-align: left;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

/* Style layers checkboxes */
.style-layers-container {
  border-top: 1px solid rgba(75, 85, 99, 0.3);
  padding: 12px;
  font-size: 12px;
  border-radius: 0 0 8px 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.style-layer-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.style-layer-item:hover {
  background-color: rgba(63, 63, 70, 0.4);
}

.unicode-light .style-layer-item:hover {
  background-color: rgba(229, 231, 235, 0.6);
}

.style-layer-item:last-child {
  margin-bottom: 0;
}

.style-layer-checkbox {
  margin-right: 8px;
  cursor: pointer;
}

.style-layer-preview {
  margin-left: auto;
  font-size: 14px;
  opacity: 0.85;
  font-weight: 500;
}

.layer-apply-btn,
.layer-clear-btn {
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: rgba(34, 197, 94, 0.85);
  color: white;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.layer-clear-btn {
  background-color: rgba(107, 114, 128, 0.7);
}

.layer-apply-btn:hover {
  background-color: rgba(34, 197, 94, 1);
  transform: translateY(-1px);
}

.layer-clear-btn:hover {
  background-color: rgba(107, 114, 128, 0.9);
  transform: translateY(-1px);
}

/* Preview element styling */
.unicode-preview {
  position: absolute;
  right: 10px;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.unicode-preview.highlighted {
  opacity: 1;
  font-weight: bold;
}

.unicode-suggestion-popup .header {
  padding: 12px;
  border-bottom: 1px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px 8px 0 0;
}

.unicode-char-counter {
  position: absolute;
  right: 40px;
  bottom: 8px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  font-family: system-ui, sans-serif;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.unicode-char-counter.warning {
  color: #f59e0b;
}

.unicode-char-counter.error {
  color: #ef4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Tab navigation styling */
.tab-navigation {
  display: flex;
  border-bottom: 1px solid;
  background-color: rgba(24, 24, 27, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.unicode-light .tab-navigation {
  background-color: rgba(249, 250, 251, 0.85);
  border-bottom-color: rgba(209, 213, 219, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.unicode-dark .tab-navigation,
.tab-navigation {
  border-bottom-color: rgba(55, 65, 81, 0.5);
}

.tab-button {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  flex: 1;
  text-align: center;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  color: inherit;
}

.tab-button.active {
  border-bottom-color: #22c55e;
  font-weight: 600;
}

.unicode-light .tab-button:hover {
  background-color: rgba(243, 244, 246, 0.6);
}

.unicode-dark .tab-button:hover,
.tab-button:hover {
  background-color: rgba(39, 39, 42, 0.6);
}

/* Tab content styling */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Currency category styling */
.currency-category {
  padding: 8px 0;
}

.currency-category-title,
.special-chars-category-title {
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #22c55e;
  margin: 0 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.currency-options {
  max-height: 256px;
  overflow-y: auto;
  padding: 0 8px;
  background-color: transparent;
}

/* Custom thin scrollbar for currency options */
.currency-options::-webkit-scrollbar {
  width: 6px;
}
.currency-options::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
}
.currency-options {
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}
.suggestion-options::-webkit-scrollbar {
  width: 6px;
}
.suggestion-options::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
}
.suggestion-options {
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}
.currency-options button {
  width: 100%;
  text-align: left;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.currency-symbol {
  display: inline-block;
  width: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}

/* Special characters category styling */
.special-chars-category {
  padding: 8px 0;
}

.special-chars-category-title {
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #22c55e;
  margin: 0 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.special-chars-options {
  max-height: 256px;
  overflow-y: auto;
  padding: 0 8px;
  background-color: transparent;
}

/* Custom thin scrollbar for special chars options */
.special-chars-options::-webkit-scrollbar {
  width: 6px;
}
.special-chars-options::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
}
.special-chars-options {
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}

.special-chars-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 4px 8px;
}

.special-char-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 16px;
  font-weight: 500;
}

.special-char-btn:hover {
  background-color: rgba(59, 130, 246, 0.1);
  transform: scale(1.1);
}
.tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: #18181b;
  color: #34d399;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  z-index: 10;
}

.group:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(8px);
}

.unicode-scroller::-webkit-scrollbar {
  width: 6px;
  height: 8px;
}

.unicode-scroller::-webkit-scrollbar-track {
  background: inherit;
  border-radius: 4px;
}

.unicode-scroller::-webkit-scrollbar-thumb {
  background: inherit;
  border-radius: 4px;
}

.unicode-scroller::-webkit-scrollbar-thumb:hover {
  background: #6366f1;
}

#editor:focus {
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
}

/* Dark theme (your original design) */
.unicode-dark .unicode-suggestion-btn,
.unicode-suggestion-btn {
  /* Default to dark unless overridden */
  background-color: rgba(34, 197, 94, 0.85);
  color: white;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.unicode-dark .unicode-suggestion-popup,
.unicode-suggestion-popup {
  /* Default to dark unless overridden */
  background-color: rgba(39, 39, 42, 0.85);
  border: 1px solid rgba(75, 85, 99, 0.5);
  color: #f4f4f5;
}

.unicode-dark .unicode-suggestion-popup .suggestion-options,
.unicode-suggestion-popup .suggestion-options,
.unicode-dark .currency-options,
.currency-options,
.unicode-dark .special-chars-options,
.special-chars-options,
.unicode-dark .style-layers-container,
.style-layers-container {
  background-color: rgba(24, 24, 27, 0.75);
}

.unicode-dark .unicode-suggestion-popup .suggestion-options button,
.unicode-suggestion-popup .suggestion-options button,
.unicode-dark .currency-options button,
.currency-options button,
.unicode-dark .special-chars-options button,
.special-chars-options button,
.unicode-dark .style-layer-item,
.style-layer-item {
  color: #f4f4f5;
}

.unicode-dark .unicode-suggestion-popup .suggestion-options button:hover,
.unicode-suggestion-popup .suggestion-options button:hover,
.unicode-dark .currency-options button:hover,
.currency-options button:hover,
.unicode-dark .special-chars-options button:hover,
.special-chars-options button:hover {
  background-color: rgba(63, 63, 70, 0.7);
}

.unicode-dark .unicode-suggestion-popup .header,
.unicode-suggestion-popup .header {
  border-bottom-color: rgba(55, 65, 81, 0.5);
  background-color: rgba(24, 24, 27, 0.85);
}

.unicode-dark .unicode-char-counter,
.unicode-char-counter {
  color: #d1d5db;
}

.unicode-dark .style-layers-container,
.style-layers-container {
  border-top-color: #374151;
}

/* Light theme */
.unicode-light .unicode-suggestion-btn {
  background-color: rgba(
    34,
    197,
    94,
    0.85
  ); /* Keep the green for consistency */
  color: white;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.unicode-light .unicode-suggestion-popup {
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(209, 213, 219, 0.5);
  color: #1f2937;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.unicode-light .unicode-suggestion-popup .suggestion-options,
.unicode-light .currency-options,
.unicode-light .special-chars-options,
.unicode-light .style-layers-container {
  background-color: rgba(249, 250, 251, 0.75);
}

.unicode-light .unicode-suggestion-popup .suggestion-options button,
.unicode-light .currency-options button,
.unicode-light .special-chars-options button,
.unicode-light .style-layer-item {
  color: #1f2937;
}

.unicode-light .unicode-suggestion-popup .suggestion-options button:hover,
.unicode-light .currency-options button:hover,
.unicode-light .special-chars-options button:hover {
  background-color: rgba(229, 231, 235, 0.7);
}

.unicode-light .unicode-suggestion-popup .header {
  border-bottom-color: rgba(209, 213, 219, 0.5);
  background-color: rgba(249, 250, 251, 0.85);
}

.unicode-light .unicode-char-counter {
  color: #4b5563;
  background: rgba(255, 255, 255, 0.7); /* Light background for visibility */
}

.unicode-light .style-layers-container {
  border-top-color: #d1d5db;
}

/* Site-specific themes */
/* Twitter theme */
.site-twitter .unicode-suggestion-btn {
  padding-top: 4px;
  background-color: rgba(29, 161, 242, 0.9);
  border-color: rgba(29, 161, 242, 0.3);
}

.site-twitter .viblify-dot {
  background: linear-gradient(45deg, #1da1f2, #1991d9);
}

.site-twitter .unicode-suggestion-btn.compact:hover .viblify-dot {
  box-shadow: 0 0 8px rgba(29, 161, 242, 0.6);
}

.site-twitter .tab-button.active {
  border-bottom-color: #1da1f2;
}

.site-twitter .currency-category-title {
  color: #1da1f2;
}

/* Facebook theme */
.site-facebook .unicode-suggestion-btn {
  background-color: rgba(66, 103, 178, 0.9);
  border-color: rgba(66, 103, 178, 0.3);
}

.site-facebook .viblify-dot {
  background: linear-gradient(45deg, #4267b2, #365899);
}

.site-facebook .unicode-suggestion-btn.compact:hover .viblify-dot {
  box-shadow: 0 0 8px rgba(66, 103, 178, 0.6);
}

.site-facebook .tab-button.active {
  border-bottom-color: #4267b2;
}

.site-facebook .currency-category-title {
  color: #4267b2;
}

/* LinkedIn theme */
.site-linkedin .unicode-suggestion-btn {
  background-color: rgba(0, 119, 181, 0.9);
  border-color: rgba(0, 119, 181, 0.3);
}

.site-linkedin .viblify-dot {
  background: linear-gradient(45deg, #0077b5, #005885);
}

.site-linkedin .unicode-suggestion-btn.compact:hover .viblify-dot {
  box-shadow: 0 0 8px rgba(0, 119, 181, 0.6);
}

.site-linkedin .tab-button.active {
  border-bottom-color: #0077b5;
}

.site-linkedin .currency-category-title {
  color: #0077b5;
}

/* Instagram theme */
.site-instagram .unicode-suggestion-btn {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
  border-color: rgba(225, 48, 108, 0.3);
}

.site-instagram .viblify-dot {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
}

.site-instagram .unicode-suggestion-btn.compact:hover .viblify-dot {
  box-shadow: 0 0 8px rgba(225, 48, 108, 0.6);
}

.site-instagram .tab-button.active {
  border-bottom-color: #e1306c;
}

.site-instagram .currency-category-title {
  color: #e1306c;
}

/* Reddit theme */
.site-reddit .unicode-suggestion-btn {
  background-color: rgba(255, 86, 0, 0.9);
  border-color: rgba(255, 86, 0, 0.3);
}

.site-reddit .viblify-dot {
  background: linear-gradient(45deg, #ff5600, #e64a00);
}

.site-reddit .unicode-suggestion-btn.compact:hover .viblify-dot {
  box-shadow: 0 0 8px rgba(255, 86, 0, 0.6);
}

.site-reddit .tab-button.active {
  border-bottom-color: #ff5600;
}

.site-reddit .currency-category-title {
  color: #ff5600;
}

/* GitHub theme */
.site-github .unicode-suggestion-btn {
  background-color: rgba(36, 41, 46, 0.9);
  border-color: rgba(36, 41, 46, 0.3);
}

.site-github .viblify-dot {
  background: linear-gradient(45deg, #24292e, #1b1f23);
}

.site-github .unicode-suggestion-btn.compact:hover .viblify-dot {
  box-shadow: 0 0 8px rgba(36, 41, 46, 0.6);
}

.site-github .tab-button.active {
  border-bottom-color: #24292e;
}

.site-github .currency-category-title {
  color: #24292e;
}

/* Toast Notification Styles */
.viblify-toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
  z-index: 10000; /* Ensure it's on top */
  opacity: 0;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  pointer-events: none; /* Allow clicks through if not interacted with */
}

.viblify-toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0); /* Animate in */
  pointer-events: auto;
}

.viblify-toast-notification.viblify-toast-success {
  background-color: #28a745; /* Green for success */
  color: white;
}

.viblify-toast-notification.viblify-toast-error {
  background-color: #dc3545; /* Red for error */
  color: white;
}

.viblify-toast-notification.viblify-toast-info {
  background-color: #17a2b8; /* Blue for info */
  color: white;
}

.viblify-toast-notification.viblify-toast-warning {
  background-color: #ffc107; /* Yellow for warning */
  color: #212529; /* Dark text for yellow background */
}

/* Light theme dot styling */
.unicode-light .viblify-dot {
  background: linear-gradient(45deg, #10b981, #059669);
}

.unicode-light .unicode-suggestion-btn.compact:hover .viblify-dot {
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Dark theme dot styling */
.unicode-dark .viblify-dot,
.viblify-dot {
  background: linear-gradient(45deg, #667eea, #764ba2);
}

.unicode-dark .unicode-suggestion-btn.compact:hover .viblify-dot,
.unicode-suggestion-btn.compact:hover .viblify-dot {
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
}
