/* ===========================
   OneFav Styles met Dark Mode
   =========================== */

/* CSS Variables voor Light & Dark Mode */
:root {
  /* Safe area insets */
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
  
  /* Light mode colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-body: #f3f4f6;
  
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  
  --border-color: #e5e7eb;
  --border-color-hover: #d1d5db;
  
  --accent-color: #0ea5e9;
  --accent-hover: #0284c7;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  
  --ring-color: rgba(14, 165, 233, 0.5);
}

/* Dark mode colors */
[data-theme="dark"] {
  --bg-primary: #1e293b;
  --bg-secondary: #0f172a;
  --bg-tertiary: #334155;
  --bg-body: #0f172a;
  
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  
  --border-color: #334155;
  --border-color-hover: #475569;
  
  --accent-color: #38bdf8;
  --accent-hover: #0ea5e9;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  
  --ring-color: rgba(56, 189, 248, 0.5);
}

/* Smooth theme transition */
* {
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

/* Scrollbar styling */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Drag styles */
.sortable-ghost {
  opacity: 0.4;
}

.sortable-drag {
  cursor: grabbing;
}

/* Discrete drag indicator */
.drag-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 14px;
  line-height: 1;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 2px 6px;
  border-radius: 9999px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-backdrop-filter: saturate(1.2) blur(2px);
  backdrop-filter: saturate(1.2) blur(2px);
}

[data-theme="dark"] .drag-indicator {
  background: rgba(241, 245, 249, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(241, 245, 249, 0.15);
}

.card.is-dragging .drag-indicator {
  opacity: 1;
  transform: translateY(0);
}

/* Card transitions */
.card {
  transition: box-shadow 140ms ease, transform 140ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
  * {
    transition: none !important;
  }
}

.card.is-dragging {
  box-shadow:
    0 0 0 2px var(--ring-color),
    0 10px 28px rgba(2, 6, 23, .18);
  transform: translateZ(0) scale(1.02);
}

[data-theme="dark"] .card.is-dragging {
  box-shadow:
    0 0 0 2px var(--ring-color),
    0 10px 28px rgba(0, 0, 0, .5);
}

/* Theme toggle button animation */
.theme-toggle {
  transition: transform 200ms ease;
}

.theme-toggle:hover {
  transform: rotate(20deg);
}

.theme-toggle:active {
  transform: rotate(20deg) scale(0.95);
}

/* Dark mode icon animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.theme-icon {
  animation: fadeIn 200ms ease;
}

/* Footer styling */
footer {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

footer a {
  position: relative;
  text-decoration: none;
}

footer a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  background: currentColor;
  transition: width 200ms ease;
}

footer a:hover::after {
  width: 100%;
}

/* Category chips styling */
#chipRow button {
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

#chipRow button:active {
  transform: scale(0.95);
}

/* Pinned card styling */
.card.pinned {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 0 1px #fbbf24 inset;
}

[data-theme="dark"] .card.pinned {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 1px #f59e0b inset;
}

/* Swipe animation hint */
.card {
  transition: transform 150ms ease-out;
}

.card:active {
  transform: scale(0.98);
}

/* Quick Add Dialog Animation */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scale-in 200ms ease-out;
}

/* Install Banner Animation */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 300ms ease-out;
}

/* Install banner sliding animation */
@keyframes slide-in-from-top {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-in-from-top {
  animation: slide-in-from-top 400ms ease-out;
}

/* ===========================
   Scrollbar Styling
   =========================== */

/* Thin scrollbar for webkit browsers */
.scrollbar-thin {
  scrollbar-width: thin;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.7);
}

/* Dark mode scrollbar */
[data-theme="dark"] .scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.5);
}

[data-theme="dark"] .scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.7);
}

/* ===========================
   Text Utilities
   =========================== */

/* Line clamp for multi-line text truncation */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ===========================
   Sortable Drag & Drop Styles
   =========================== */

.sortable-ghost {
  opacity: 0.5;
  background: var(--bg-tertiary);
  transform: rotate(5deg);
  transition: all 0.2s ease;
}

.sortable-chosen {
  cursor: grabbing !important;
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.sortable-drag {
  opacity: 0.8;
  transform: rotate(2deg);
}

/* Mobile-specific drag & drop enhancements */
@media (max-width: 768px) {
  .sortable-ghost {
    opacity: 0.6;
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }
  
  .sortable-chosen {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
  }
  
  .sortable-drag {
    opacity: 0.9;
    transform: scale(1.05);
  }
  
  /* Enhanced touch targets for mobile */
  .card {
    min-height: 60px;
    touch-action: manipulation;
  }
  
  /* Mobile drag handle styling */
  .mobile-drag-handle {
    opacity: 0;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 2px;
  }
  
  .card:hover .mobile-drag-handle,
  .card.touch-drag-ready .mobile-drag-handle {
    opacity: 1 !important;
  }
  
  /* Long press indicator for mobile drag */
  .card.touch-drag-ready {
    animation: pulse-drag 1s ease-in-out;
    border: 2px dashed var(--accent-color);
    transform: scale(1.02);
  }
  
  /* Show drag handle when sort order is custom */
  .grid[data-sort-order="custom"] .mobile-drag-handle {
    opacity: 0.6;
  }
  
  .grid[data-sort-order="custom"] .card:hover .mobile-drag-handle {
    opacity: 1;
  }
}

@keyframes pulse-drag {
  0%, 100% { transform: scale(1.02); }
  50% { transform: scale(1.05); }
}

/* ===========================
   Scrollbar Hiding
   =========================== */

.scrollbar-none {
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
  scrollbar-width: none;     /* Firefox */
}

.scrollbar-none::-webkit-scrollbar { 
  display: none;             /* Safari and Chrome */
}

/* ===========================
   Sync Status Indicators
   =========================== */

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

.sync-active {
  animation: pulse-sync 2s infinite;
}

.sync-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.sync-status-online {
  background-color: #10b981; /* green */
}

.sync-status-syncing {
  background-color: #3b82f6; /* blue */
  animation: pulse-sync 1s infinite;
}

.sync-status-error {
  background-color: #ef4444; /* red */
}

.sync-status-offline {
  background-color: #6b7280; /* gray */
}

/* Add grab cursor to draggable cards */
#grid .card {
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#grid .card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#grid .card:active {
  cursor: grabbing;
  transform: scale(0.98);
}

/* Smooth animations for reordering */
#grid {
  transition: all 0.3s ease;
  /* Force grid layout recalculation when classes change */
  display: grid !important;
}

/* Ensure grid column classes are applied immediately */
#grid[class*="grid-cols-"] {
  display: grid !important;
}

#grid .card {
  will-change: transform;
}

/* PWA Install Indicator Animations */
#pwaInstallIndicator {
  animation: fadeInSlide 0.5s ease-out;
}

#pwaInstallIndicator:hover {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile Install Hint Enhanced Animation */
#mobileInstallHint {
  animation: slideUpBounce 0.6s ease-out;
}

@keyframes slideUpBounce {
  0% {
    opacity: 0;
    transform: translateY(100px);
  }
  60% {
    opacity: 1;
    transform: translateY(-10px);
  }
  80% {
    transform: translateY(5px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Install Banner Enhanced Slide Animation */
.animate-slide-down {
  animation: slideDownFade 0.5s ease-out;
}

@keyframes slideDownFade {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* PWA Install Button Pulse Effect */
#btnInstallPWA:not(.hidden) {
  animation: subtlePulse 2s infinite;
}

@keyframes subtlePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
  }
}

/* Install Modal Enhanced Animation */
#installInstructionsModal .rounded-2xl {
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===========================
   Bookmark Drop Zone Styles
   =========================== */

.drop-zone {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.drop-zone.drag-over {
  border-color: var(--accent-color);
  background-color: rgba(14, 165, 233, 0.1);
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.2);
}

.drop-zone.drag-over .drop-zone-content {
  display: none;
}

.drop-zone.drag-over .drop-zone-active {
  display: block !important;
}

.drop-zone .drop-zone-active {
  display: none;
}

/* Drop zone animations */
@keyframes dropZoneShow {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropZonePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.drop-zone.show {
  display: block !important;
  animation: dropZoneShow 0.3s ease-out;
}

.drop-zone.drag-over {
  animation: dropZonePulse 1s ease-in-out infinite;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .drop-zone {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .drop-zone h3 {
    font-size: 1rem;
  }
  
  .drop-zone p {
    font-size: 0.875rem;
  }
  
  .drop-zone svg {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .drop-zone.drag-over svg {
    width: 3rem;
    height: 3rem;
  }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
  .drop-zone.drag-over {
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.3);
  }
}

/* Mobile/Desktop Search Sync Styles */
.search-controls-collapsed {
  max-height: 0;
  opacity: 0;
}

.search-controls-expanded {
  max-height: 60px;
  opacity: 1;
}

/* Mobile search bar positioned at bottom */
#mobileSearchContainer {
  /* Safe area inset for mobile devices */
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

/* Ensure mobile search is above other content */
@media (max-width: 768px) {
  #mobileSearchContainer {
    z-index: 30;
  }
  
  /* Add extra padding to main content for mobile search bar */
  main {
    padding-bottom: calc(8rem + env(safe-area-inset-bottom)) !important;
  }
}

/* ===========================
   Share Notification Styles
   =========================== */

.share-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  z-index: 10000;
  max-width: 350px;
  animation: slideInRight 0.3s ease-out;
}

.share-notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-notification i.fa-share-alt {
  color: var(--accent-color);
  font-size: 1.2em;
  flex-shrink: 0;
}

.share-text {
  flex: 1;
  min-width: 0;
}

.share-text strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}

.share-details {
  color: var(--text-secondary);
  font-size: 0.9em;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.share-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

@media(max-width: 768px) {
  .share-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* ===========================
   Context Menu Styles
   =========================== */

.onefav-context-menu {
  position: fixed;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  z-index: 10000;
  min-width: 200px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.onefav-context-menu.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.onefav-context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  color: var(--text-primary);
}

.onefav-context-menu-item:hover {
  background: var(--bg-tertiary);
}

.onefav-context-menu-item:active {
  background: var(--bg-secondary);
}

.onefav-context-menu-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-color);
  flex-shrink: 0;
}

.onefav-context-menu-text {
  flex: 1;
  font-weight: 500;
}

.onefav-context-menu-shortcut {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.onefav-context-menu-separator {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.onefav-context-menu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.onefav-context-menu-header-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-color);
}

[data-theme="dark"] .onefav-context-menu {
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* ===========================
   Detailed Card View (Grid Size)
   =========================== */

/* Detailed grid layout */
#grid.detailed-view {
  grid-template-columns: 1fr !important;
  gap: 1rem;
  max-width: 100%;
}

/* Tablet: 2 columns for detailed view */
@media (min-width: 640px) {
  #grid.detailed-view {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem;
  }
}

/* Desktop: 3 columns for detailed view */
@media (min-width: 1024px) {
  #grid.detailed-view {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem;
  }
}

/* Large Desktop: Still 3 columns but with more spacing */
@media (min-width: 1536px) {
  #grid.detailed-view {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem;
  }
}

/* Ensure detailed cards take full width */
.app-card-detailed {
  width: 100%;
  max-width: none;
}

/* Detailed card styling */
.app-card-detailed {
  position: relative;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  transition: all 0.2s ease;
}

.app-card-detailed:hover {
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 0.1);
  border-color: #0ea5e9;
  transform: translateY(-2px);
}

[data-theme="dark"] .app-card-detailed {
  background: rgb(30 41 59 / 0.8);
  border-color: #334155;
}

[data-theme="dark"] .app-card-detailed:hover {
  border-color: #0ea5e9;
  background: rgb(30 41 59 / 0.95);
}

/* Card actions (favorite & delete buttons) */
.card-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.app-card-detailed:hover .card-actions {
  opacity: 1;
}

.card-action-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.card-action-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-action-btn.card-favorite:hover {
  background: #fef3c7;
  border-color: #fbbf24;
}

.card-action-btn.card-favorite.active {
  background: #fbbf24;
  border-color: #f59e0b;
}

.card-action-btn.card-delete:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

[data-theme="dark"] .card-action-btn {
  background: #1e293b;
  border-color: #475569;
}

/* App icon (large for detailed view) */
.app-icon-large {
  width: 4rem;
  height: 4rem;
  border-radius: 0.75rem;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  background: white;
  flex-shrink: 0;
}

[data-theme="dark"] .app-icon-large {
  border-color: #334155;
  background: #0f172a;
}

/* App name (detailed) */
.app-name-detailed {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

[data-theme="dark"] .app-name-detailed {
  color: #f1f5f9;
}

/* App description */
.app-description {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin-top: 0.25rem;
}

[data-theme="dark"] .app-description {
  color: #94a3b8;
}

/* App tags */
.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.app-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #bfdbfe;
}

[data-theme="dark"] .app-tag {
  background: #1e3a8a;
  color: #93c5fd;
  border-color: #1e40af;
}

/* Mobile responsiveness for detailed cards */
@media (max-width: 640px) {
  .app-card-detailed {
    padding: 1rem;
  }

  .app-icon-large {
    width: 3rem;
    height: 3rem;
  }

  .app-name-detailed {
    font-size: 1rem;
  }

  .app-description {
    font-size: 0.8125rem;
  }
}

/* Grid size transitions */
#favGrid {
  transition: gap 0.3s ease;
}

/* Detailed Layout - Wider containers for desktop experience */
@media (min-width: 768px) {
  /* Header transitions smoothly when switching to detailed view */
  header .mx-auto {
    transition: max-width 0.3s ease, padding 0.3s ease;
  }
  
  /* Search section gets more breathing room in detailed view */
  #search-section.detailed-layout .search-container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
  }
  
  #search-section.detailed-layout {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  /* Quick actions spread out nicely on desktop in detailed view */
  #search-section.detailed-layout .quick-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 1280px;
    margin: 0 auto;
  }
  
  /* Search input gets more prominent in detailed view */
  #search-section.detailed-layout .search-input-wrapper {
    max-width: 800px;
    margin: 0 auto;
  }
  
  /* Search title and subtitle centered nicely */
  #search-section.detailed-layout .search-title,
  #search-section.detailed-layout .search-subtitle {
    text-align: center;
  }
}

/* ===========================
   Context Menu Styling
   =========================== */

.context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 240px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 
              0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 0.5rem;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.context-menu.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-primary);
  font-size: 0.875rem;
  user-select: none;
}

.context-menu-item:hover {
  background: var(--bg-secondary);
  color: var(--accent-color);
}

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

.context-menu-item svg {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.context-menu-item:hover svg {
  color: var(--accent-color);
}

.context-menu-item span {
  flex: 1;
}

.context-menu-item kbd {
  margin-left: auto;
  padding: 0.125rem 0.375rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--text-tertiary);
}

.context-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.375rem 0;
}

.context-menu-danger {
  color: #ef4444;
}

.context-menu-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

[data-theme="dark"] .context-menu-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* Context Menu Toast Notification */
.context-menu-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-size: 0.875rem;
  max-width: 90%;
  text-align: center;
}

.context-menu-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Prevent text selection during right-click */
.card[data-context-menu-enabled] {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* Context menu animation on dark mode */
[data-theme="dark"] .context-menu {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 
              0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Hover effect for cards with context menu */
.card[data-context-menu-enabled]:hover {
  cursor: context-menu;
}

/* ===========================
   Footer Styling
   =========================== */

footer {
  transition: all 0.3s ease;
}

/* Footer link hover effects */
footer a:not(.footer-link-coffee) {
  position: relative;
}

footer a:not(.footer-link-coffee):hover {
  transform: translateY(-1px);
}

/* Buy me a coffee special animation */
.footer-link-coffee {
  animation: pulse-subtle 3s ease-in-out infinite;
}

@keyframes pulse-subtle {
  0%, 100% {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
  }
}

.footer-link-coffee:hover {
  animation: none;
}

/* Gradient text support for header */
.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}

.text-transparent {
  color: transparent;
}

/* Ensure gradient works in Safari */
@supports (-webkit-background-clip: text) {
  .bg-gradient-to-r.from-blue-600.to-purple-600.bg-clip-text {
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Footer responsive adjustments */
@media (max-width: 768px) {
  footer .flex-col {
    gap: 0.5rem;
  }
  
  footer a {
    font-size: 0.75rem;
  }
}
