/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Header Components */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Button Components */
.add-link-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.add-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.add-link-btn:active {
  transform: translateY(0);
}

.control-btn {
  background: white;
  color: #64748b;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #374151;
  transform: translateY(-1px);
}

/* Profile Buttons */
.profile-btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-btn-active {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.profile-btn-inactive {
  background: white;
  color: #64748b;
  border: 2px solid #e2e8f0;
}

.profile-btn-inactive:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  color: #3b82f6;
}

/* Input Components */
.search-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: #1e293b;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.filter-select {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: #1e293b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Options Menu */
.options-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  width: 200px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  z-index: 50;
}

.menu-option {
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-option:hover {
  background: #f8fafc;
}

/* Link Cards */
.link-card {
  background: white;
  border: 2px solid #f1f5f9;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  border-color: #e0e7ff;
}

.link-card.visited {
  opacity: 0.6;
  background: #f8fafc;
}

/* Action Buttons */
.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Tags and Badges */
.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
}

.group-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #bbf7d0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 32px;
  background: white;
  border: 2px solid #f1f5f9;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-container {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content {
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  border: 2px solid #f1f5f9;
}

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

.modal-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #374151;
}

/* Form Styles */
.modal-form {
  padding: 32px;
  gap: 24px;
  display: flex;
  flex-direction: column;
}

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

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.form-input {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: #1e293b;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
  color: #94a3b8;
}

.error-text {
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 2px solid #f1f5f9;
}

.cancel-btn {
  padding: 12px 24px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.submit-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Deleted Links Modal */
.deleted-links-list {
  padding: 32px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deleted-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8fafc;
  border: 2px solid #f1f5f9;
  border-radius: 12px;
}

.restore-btn {
  padding: 8px 16px;
  border: 2px solid #10b981;
  border-radius: 8px;
  background: white;
  color: #10b981;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.restore-btn:hover {
  background: #ecfdf5;
}

.delete-forever-btn {
  padding: 8px 16px;
  border: 2px solid #dc2626;
  border-radius: 8px;
  background: white;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.delete-forever-btn:hover {
  background: #fef2f2;
}

.no-deleted-links {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

/* Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Animations */
.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

/* Transitions */
[x-transition] {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-container {
    max-width: 95vw;
  }
  
  .modal-header,
  .modal-form {
    padding: 20px;
  }
  
  .link-card {
    padding: 16px;
  }
  
  .add-link-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .modal-overlay,
  header {
    display: none !important;
  }
  
  body {
    background: white !important;
  }
}

/* Toast Notifications */
.toast {
  background: white;
  border-left: 4px solid;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 400px;
  animation: slideInRight 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.toast-success {
  border-left-color: #10b981;
  background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 100%);
}

.toast-error {
  border-left-color: #ef4444;
  background: linear-gradient(90deg, #fef2f2 0%, #ffffff 100%);
}

.toast-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, #fffbeb 0%, #ffffff 100%);
}

.toast-info {
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #6b7280;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.8));
  animation: progressBar linear;
}

/* Validation Feedback */
.error-feedback {
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.error-feedback::before {
  content: '\f071';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
}

.success-feedback {
  color: #059669;
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.success-feedback::before {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
}

.info-feedback {
  color: #0369a1;
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-feedback::before {
  content: '\f05a';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
}

/* Input States */
.form-input.valid {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.loading {
  border-color: #3b82f6;
  position: relative;
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes progressBar {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Loading States */
.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.submit-btn:disabled:hover {
  transform: none !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* ... existing styles ... */

/* New Badge Styles */
.visited-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 700;
  border-radius: 16px;
  border: 1px solid #bbf7d0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tag Selection Styles */
.tag-selection-btn {
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-badge-available {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.tag-badge-available:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.tag-badge-selected {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

/* Multi-select Container */
.tag-multi-select {
  max-height: 120px;
  overflow-y: auto;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

/* Group Selection Enhancement */
.form-input option:disabled {
  color: #9ca3af;
  font-style: italic;
}

/* Link validation indicator */
.url-validation-spinner {
  animation: spin 1s linear infinite;
}

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

/* Domain and Tag Filter Enhancements */
.filter-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .grid.lg\\:grid-cols-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .grid.lg\\:grid-cols-5 {
    grid-template-columns: 1fr;
  }
  
  .profile-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ... existing styles ... */

/* Visited Tag Badge - Different from regular tags */
.visited-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid #10b981;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* Visually Greyed State - Different from visited tag */
.link-card.visually-greyed {
  opacity: 0.5;
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: none !important;
}

.link-card.visually-greyed:hover {
  opacity: 0.7;
  transform: translateY(-2px) !important;
}

/* Clear Preferences Button */
.control-btn[title="Clear Preferences"]:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Enhanced Action Button States */
.action-btn[title="Toggle visual greyed state"] {
  position: relative;
}

.action-btn[title="Toggle visual greyed state"]:hover::after {
  content: "Toggle Greyed";
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: #374151;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 10;
}

/* Improve tag selection in form */
.tag-selection-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Better visual feedback for greyed links */
.link-card.visually-greyed .tag-badge,
.link-card.visually-greyed .group-badge {
  opacity: 0.6;
}

.link-card.visually-greyed .visited-tag-badge {
  opacity: 0.8; /* Keep visited tag more visible even when greyed */
}

/* Enhanced responsive design */
@media (max-width: 768px) {
  .control-btn[title="Clear Preferences"] {
    width: 40px;
    height: 40px;
  }
  
  .profile-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* Animation for visited tag addition */
@keyframes visitedTagPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.visited-tag-badge.newly-added {
  animation: visitedTagPulse 0.6s ease-in-out;
}


/* Filter Chips Container */
.filter-chips-container {
    margin: 16px 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 2px solid #e2e8f0;
}

.filter-chips-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

/* Individual Filter Chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid;
    transition: all 0.2s ease;
    cursor: default;
}

.filter-chip-search {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    border-color: #93c5fd;
}

.filter-chip-tag {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-color: #f59e0b;
}

.filter-chip-group {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border-color: #10b981;
}

.filter-chip-domain {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #3730a3;
    border-color: #8b5cf6;
}

.filter-chip-label {
    font-weight: 600;
}

.filter-chip-count {
    background: rgba(255, 255, 255, 0.8);
    color: inherit;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.filter-chip-remove {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: inherit;
    font-size: 10px;
}

.filter-chip-remove:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Clear All Button */
.clear-all-filters-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #dc2626;
    border: 2px solid #f87171;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clear-all-filters-btn:hover {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2);
}

/* Filter Dependency Hint */
.filter-dependency-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    border-left: 3px solid #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-chips-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-chips-list {
        justify-content: center;
    }
    
    .clear-all-filters-btn {
        align-self: center;
        margin-top: 8px;
    }
    
    .filter-chip {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* Hover animations */
.filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animation for chip removal */
.filter-chip.removing {
    animation: chipFadeOut 0.2s ease-out forwards;
}

@keyframes chipFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}
/* GitHub Sync Styles */
.github-config-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.github-sync-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.github-sync-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
}

.github-sync-btn.export {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.github-sync-btn.export:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.github-sync-btn.import {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.github-sync-btn.import:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.github-sync-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.github-sync-btn .fab.fa-github {
    font-size: 16px;
}

.github-sync-btn .fas {
    font-size: 12px;
}

.github-help-text {
    text-align: center;
    color: #64748b;
}

.github-help-text a {
    color: #3b82f6;
    text-decoration: none;
}

.github-help-text a:hover {
    text-decoration: underline;
}

/* Dropdown Search Styles *//* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #1e293b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.custom-dropdown-trigger:hover {
    border-color: #cbd5e1;
}

.custom-dropdown-trigger:focus,
.custom-dropdown-trigger.active {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.custom-dropdown-trigger i {
    transition: transform 0.2s ease;
    color: #64748b;
}

.custom-dropdown-trigger i.rotate-180 {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 100;
    margin-top: 4px;
    overflow: hidden;
}

.dropdown-search-container {
    padding: 12px 16px;
    border-bottom: 2px solid #f1f5f9;
    background: #f8fafc;
}

.dropdown-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.dropdown-search-input:focus {
    border-color: #3b82f6;
}

.dropdown-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 0;
}

.dropdown-option {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-option:hover {
    background: #f1f5f9;
}

.dropdown-option.selected {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-no-results {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-style: italic;
    font-size: 13px;
}

/* Custom scrollbar for dropdown options */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .github-sync-buttons {
        flex-direction: column;
    }
    
    .github-sync-btn {
        min-width: auto;
    }
    
    .custom-dropdown-menu {
        position: fixed;
        top: 50%;
        left: 16px;
        right: 16px;
        transform: translateY(-50%);
        max-height: 70vh;
    }
    
    .dropdown-options {
        max-height: calc(70vh - 80px);
    }
}

/* Animation for dropdown transitions */
[x-transition] {
    transition: all 0.2s ease-in-out;
}

[x-transition][x-transition\:enter] {
    opacity: 0;
    transform: translateY(-10px);
}

[x-transition][x-transition\:enter-end] {
    opacity: 1;
    transform: translateY(0);
}

[x-transition][x-transition\:leave] {
    opacity: 1;
    transform: translateY(0);
}

[x-transition][x-transition\:leave-end] {
    opacity: 0;
    transform: translateY(-10px);
}

/* Tag Selection Search Styles */
.tag-selection-search {
    margin-bottom: 12px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.tag-selection-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tag-selection-search::placeholder {
    color: #94a3b8;
    font-style: italic;
}

.tag-selection-container {
    max-height: 500px;
    overflow-y: auto;
    border: 2px solid #f1f5f9;
    border-radius: 8px;
    padding: 8px;
    background: #f8fafc;
}

.no-tags-found {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    font-style: italic;
    padding: 12px;
}


/* Tag Search Container with Clear Icon */
.tag-search-container {
    position: relative;
    margin-bottom: 12px;
}

.tag-selection-search {
    width: 100%;
    padding: 8px 35px 8px 12px; /* Add right padding for clear button */
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    transition: border-color 0.2s ease;
    margin-bottom: 0; /* Remove existing margin since container handles it */
}

.tag-selection-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tag-selection-search::placeholder {
    color: #94a3b8;
    font-style: italic;
}

/* Enhanced Clear Search Button - More Visible */
.tag-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: #f1f5f9; /* ADD visible background */
    color: #64748b; /* DARKER color */
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
    border: 1px solid #e2e8f0; /* ADD border for definition */
}

.tag-search-clear:hover {
    background: #3b82f6; /* BLUE background on hover */
    color: white; /* WHITE text on hover */
    border-color: #3b82f6;
    transform: translateY(-50%) scale(1.1);
}

.tag-search-clear:active {
    background: #1d4ed8; /* DARKER blue when clicked */
    color: white;
    transform: translateY(-50%) scale(0.95);
}

/* Focus state for accessibility */
.tag-search-clear:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    background: #dbeafe;
    color: #1d4ed8;
}

/* Animation for clear button appearance */
.tag-search-clear {
    opacity: 1; /* CHANGE from 0 to 1 for immediate visibility */
    animation: none; /* REMOVE fadeIn animation that might cause visibility issues */
}

/* Alternative darker theme */
.tag-search-clear.dark-theme {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

.tag-search-clear.dark-theme:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tag-search-clear {
        width: 28px;
        height: 28px;
        right: 6px;
        font-size: 14px;
    }
    
    .tag-selection-search {
        padding: 10px 40px 10px 14px;
    }
}



/* Category Controls and Clickable Header */
.category-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clickable-header {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 12px;
    padding: 8px 12px;
    margin: -8px -12px 8px -12px;
}

.clickable-header:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.clickable-header.expanded {
    background-color: rgba(59, 130, 246, 0.1);
}

.clickable-header.expanded:hover {
    background-color: rgba(59, 130, 246, 0.15);
}

.category-chevron {
    color: #64748b;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.clickable-header:hover .category-chevron {
    color: #3b82f6;
}

.clickable-header.expanded .category-chevron {
    color: #3b82f6;
}


/* Virtual Scrolling Styles */
.virtual-scroll-container {
    position: relative;
    background: transparent;
    overflow: visible;
}

/* Category Header Layout */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.category-info {
    flex: 1;
    min-width: 0;
}

/* Categorization Controls */
.categorization-controls {
    /*margin: 16px 0;*/
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef7ff 0%, #f3e8ff 100%);
    border-radius: 16px;
    border: 2px solid #e9d5ff;
}

.categorize-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    color: #8b5cf6;
    border: 2px solid #c4b5fd;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.categorize-btn:hover {
    background: #f5f3ff;
    transform: translateY(-1px);
}

.categorize-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.similarity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.similarity-slider {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #e9d5ff;
    outline: none;
    cursor: pointer;
}

.similarity-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.category-stats {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    border: 1px solid #e9d5ff;
}

/* Categorized Results */
.categorized-results {
    margin: 20px 0;
}

.category-cluster {
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 16px;
    border: 2px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f8fafc;
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.category-count {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

.category-summary {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #64748b;
    font-style: italic;
}

.similarity-score {
    padding: 4px 12px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #93c5fd;
}

.category-links {
    margin-top: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .categorization-controls .flex {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .similarity-control {
        justify-content: center;
    }
}


/* Uncategorized Section Styles */
.uncategorized-section {
    margin-top: 48px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 2px solid #e2e8f0;
}

.uncategorized-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.uncategorized-links {
    margin-top: 16px;
}

.uncategorized-card {
    opacity: 0.95;
    border: 2px solid #f1f5f9;
    background: rgba(255, 255, 255, 0.8);
}

.uncategorized-card:hover {
    opacity: 1;
    background: white;
    border-color: #e2e8f0;
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .uncategorized-section {
        margin-top: 32px;
        padding: 16px;
    }
}


.flex-together {
  display: flex; /* or display: grid; */
  width: 100%; /* Optional: Set container width */
}

.flex-together1 {
  flex-grow: 2; /* or grid-column: span 2; */
}

.flex-together2 {
  padding-left: 1rem;
  margin-left: 1rem;
  flex-grow: 1; /* or grid-column: span 1; */
}