/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 */

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Additional utility classes for colors that might be missing */
.text-green-400 { color: #4ade80; }
.text-red-400 { color: #f87171; }
.bg-green-600 { background-color: #059669; }
.bg-red-600 { background-color: #dc2626; }

/* Quote Browser Styles */
.category-tab {
  background-color: #374151;
  color: #d1d5db;
  border-color: #4b5563;
}

.category-tab:hover {
  background-color: #4b5563;
  border-color: #f97316;
  color: #fed7aa;
}

.category-tab.active {
  background-color: #f97316;
  color: #1f2937;
  border-color: #f97316;
  font-weight: 600;
}

.quote-card {
  min-height: 180px;
}

.quote-row {
  min-height: auto;
  border-radius: 8px;
}

.quote-row .truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search input with clear button */
.search-input-container {
  position: relative;
}

.search-input-container .clear-button {
  cursor: pointer;
  z-index: 10;
}

.quote-row:hover {
  border-color: #f97316;
}

.quote-row .cursor-pointer:hover {
  background-color: rgba(249, 115, 22, 0.05);
}

.expanded-content {
  animation: slideDown 0.2s ease-out;
}

.expanded-content.hidden {
  animation: slideUp 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    max-height: 200px;
  }
  to {
    opacity: 0;
    max-height: 0;
  }
}

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


/* Audio Bottom Bar Styles */
.audio-bottom-bar {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Ensure bottom bar doesn't interfere with page content */
body {
  padding-bottom: 0;
}

/* Add padding to prevent content from being hidden behind bottom bar when it's visible */
.bottom-bar-visible {
  padding-bottom: 80px;
}

/* Mobile-specific adjustments for bottom bar */
@media (max-width: 768px) {
  .bottom-bar-visible {
    padding-bottom: 70px;
  }
  
  /* Adjust mobile spacing for compact bar */
  .audio-bottom-bar .compact-controls {
    padding: 0.5rem 1rem;
  }
  
  /* Make buttons more touch-friendly on mobile */
  .audio-bottom-bar button {
    min-width: 40px;
    min-height: 40px;
  }
}

/* Smooth transitions for showing/hiding */
.audio-bottom-bar-enter {
  transform: translateY(100%);
  opacity: 0;
}

.audio-bottom-bar-enter-active {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.audio-bottom-bar-exit {
  transform: translateY(0);
  opacity: 1;
}

.audio-bottom-bar-exit-active {
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Progress bar enhancements */
.audio-bottom-bar .progress-bar {
  position: relative;
  cursor: pointer;
}

.audio-bottom-bar .progress-bar:hover .progress-fill {
  opacity: 0.8;
}

/* Volume slider specific styling for bottom bar */
.audio-bottom-bar .slider-orange {
  height: 6px;
}

.audio-bottom-bar .slider-orange::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
}

/* Stacked Bottom Bar Styles */
.stacked-bottom-bar {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Stacked bar layout - quote bar appears above music bar */
[data-stacked-bottom-bar-target="quoteBar"] {
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

/* Ensure stacked bars don't interfere with page content */
.stacked-bar-visible {
  padding-bottom: 140px; /* Space for both bars when stacked */
}

/* Single bar visible */
.single-bar-visible {
  padding-bottom: 70px; /* Space for one bar */
}

/* Green theme for music slider */
.slider-green {
  appearance: none;
  -webkit-appearance: none;
  background: #374151;
  outline: none;
  border-radius: 5px;
  height: 8px;
}

.slider-green::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #059669;
  cursor: pointer;
  border: 2px solid #bbf7d0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-green::-webkit-slider-thumb:hover {
  background: #10b981;
  transform: scale(1.1);
}

.slider-green::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #059669;
  cursor: pointer;
  border: 2px solid #bbf7d0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-green::-moz-range-thumb:hover {
  background: #10b981;
  transform: scale(1.1);
}

/* Mobile-specific adjustments for stacked bars */
@media (max-width: 768px) {
  .stacked-bar-visible {
    padding-bottom: 120px; /* Smaller spacing on mobile */
  }
  
  .single-bar-visible {
    padding-bottom: 60px;
  }
  
  /* Make stacked bars more touch-friendly on mobile */
  [data-stacked-bottom-bar-target="quoteBar"] button,
  [data-stacked-bottom-bar-target="musicBar"] button {
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Adjust padding for mobile stacked bars */
  [data-stacked-bottom-bar-target="quoteBar"] .px-4,
  [data-stacked-bottom-bar-target="musicBar"] .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Smooth transitions for stacked bars */
[data-stacked-bottom-bar-target="quoteBar"],
[data-stacked-bottom-bar-target="musicBar"] {
  transition: all 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Fade-out animation states */
.fade-out {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Container transition for showing/hiding */
[data-stacked-bottom-bar-target="container"] {
  transition: transform 0.4s ease-in-out, opacity 0.3s ease-in-out;
}

/* Custom very dark crimson backgrounds for quote bar */
[data-stacked-bottom-bar-target="quoteBar"] {
  background-color: #1a0a0a !important;
  border-top-color: #2d1010 !important;
  box-shadow: 0 -2px 8px rgba(60, 20, 20, 0.3);
}

[data-stacked-bottom-bar-target="quoteExpandedContent"] {
  background-color: #0f0606 !important;
  border-top-color: #2d1010 !important;
}

[data-stacked-bottom-bar-target="musicBar"] {
  box-shadow: 0 -2px 8px rgba(34, 197, 94, 0.2);
}

/* Custom range slider styling for volume control */
.slider-orange {
  appearance: none;
  -webkit-appearance: none;
  background: #374151;
  outline: none;
  border-radius: 5px;
  height: 8px;
}


.slider-orange::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ea580c;
  cursor: pointer;
  border: 2px solid #fed7aa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-orange::-webkit-slider-thumb:hover {
  background: #f97316;
  transform: scale(1.1);
}

.slider-orange::-moz-range-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ea580c;
  cursor: pointer;
  border: 2px solid #fed7aa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-orange::-moz-range-thumb:hover {
  background: #f97316;
  transform: scale(1.1);
}

.slider-orange::-moz-range-track {
  background: #374151;
  height: 8px;
  border-radius: 5px;
}

.slider-orange::-moz-range-progress {
  background: #ea580c;
  height: 8px;
  border-radius: 5px;
}

/* Custom styles for Darkest Dungeon Soundboard */

/* Base dark theme styling - must come after Tailwind base */
html {
  background: linear-gradient(135deg, #111827 0%, #000000 100%);
  min-height: 100%;
}

body {
  background: linear-gradient(135deg, #111827 0%, #000000 100%);
  color: #fed7aa;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* Card components */
.dd-card-base {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid #374151;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
}

.dd-card-hover {
  transition: all 0.2s ease;
}

.dd-card-hover:hover {
  background: rgba(55, 65, 81, 0.9);
  border-color: #ea580c;
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.3);
  transform: scale(1.05);
}

.dd-card-interactive {
  cursor: pointer;
}

/* Button components */
.dd-btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}

.dd-btn-primary {
  background: linear-gradient(135deg, #ea580c, #f97316) !important;
  color: white !important;
  border-color: #ea580c !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4) !important;
}

.dd-btn-primary:hover {
  background: linear-gradient(135deg, #f97316, #fb923c);
  box-shadow: 0 0 40px rgba(234, 88, 12, 0.4);
  transform: translateY(-1px);
}

.dd-btn-secondary {
  background: #4b5563 !important;
  color: white !important;
  border-color: #6b7280 !important;
}

.dd-btn-secondary:hover {
  background: #6b7280;
}

.dd-btn-success {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  color: white !important;
  border-color: #059669 !important;
}

.dd-btn-success:hover {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.dd-btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  color: white !important;
  border-color: #dc2626 !important;
}

.dd-btn-danger:hover {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

.dd-btn-warning {
  background: linear-gradient(135deg, #eab308, #facc15) !important;
  color: white !important;
  border-color: #eab308 !important;
}

.dd-btn-warning:hover {
  background: linear-gradient(135deg, #facc15, #fde047);
}

.dd-btn-accent {
  background: linear-gradient(135deg, #9333ea, #a855f7) !important;
  color: white !important;
  border-color: #9333ea !important;
}

.dd-btn-accent:hover {
  background: linear-gradient(135deg, #a855f7, #c084fc);
}

.dd-btn-camping {
  background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
  color: white !important;
  border-color: #1e40af !important;
}

.dd-btn-camping:hover {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

/* Official Darkest Dungeon Region Colors */
.dd-btn-ruins {
  background: linear-gradient(135deg, #8A8B8D, #9FA0A2) !important;
  color: white !important;
  border-color: #8A8B8D !important;
}

.dd-btn-ruins:hover {
  background: linear-gradient(135deg, #9FA0A2, #B4B5B7);
}

.dd-btn-cove {
  background: linear-gradient(135deg, #006CA9, #0080C7) !important;
  color: white !important;
  border-color: #006CA9 !important;
}

.dd-btn-cove:hover {
  background: linear-gradient(135deg, #0080C7, #0095E6);
}

.dd-btn-courtyard {
  background: linear-gradient(135deg, #910913, #A50F1C) !important;
  color: white !important;
  border-color: #910913 !important;
}

.dd-btn-courtyard:hover {
  background: linear-gradient(135deg, #A50F1C, #BA1B2A);
}

.dd-btn-warrens {
  background: linear-gradient(135deg, #B27F44, #C68F4F) !important;
  color: white !important;
  border-color: #B27F44 !important;
}

.dd-btn-warrens:hover {
  background: linear-gradient(135deg, #C68F4F, #DB9F5A);
}

.dd-btn-weald {
  background: linear-gradient(135deg, #A09935, #B3A63F) !important;
  color: white !important;
  border-color: #A09935 !important;
}

.dd-btn-weald:hover {
  background: linear-gradient(135deg, #B3A63F, #C6B948);
}

.dd-btn-dd {
  background: linear-gradient(135deg, #2D1B69, #3C2688) !important;
  color: white !important;
  border-color: #2D1B69 !important;
}

.dd-btn-dd:hover {
  background: linear-gradient(135deg, #3C2688, #4B31A7);
}

.dd-btn-farmstead {
  background: linear-gradient(135deg, #04B89C, #05C9AC) !important;
  color: white !important;
  border-color: #04B89C !important;
}

.dd-btn-farmstead:hover {
  background: linear-gradient(135deg, #05C9AC, #06DABC);
}

/* Typography */
.dd-heading-primary {
  font-size: 1.75rem;
  font-weight: bold;
  color: #fdba74;
}

@media (min-width: 640px) {
  .dd-heading-primary {
    font-size: 2.25rem;
  }
}

@media (min-width: 768px) {
  .dd-heading-primary {
    font-size: 3rem;
  }
}

.dd-heading-secondary {
  font-size: 1.25rem;
  font-weight: bold;
  color: #fdba74;
}

@media (min-width: 768px) {
  .dd-heading-secondary {
    font-size: 1.5rem;
  }
}

.dd-text-muted {
  color: #9ca3af;
}

.dd-text-accent {
  color: #fed7aa;
}

/* Quote display */
.dd-quote-card {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid #374151;
  border-left: 4px solid #ea580c;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dd-quote-text {
  color: #fed7aa;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

/* Category grid */
.dd-category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .dd-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .dd-category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .dd-category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.dd-category-card {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dd-category-card:hover {
  background: rgba(55, 65, 81, 0.9);
  border-color: #ea580c;
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.3);
  transform: scale(1.05);
}

.dd-category-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.dd-category-icon {
  color: #fb923c;
  font-size: 1.25rem;
  margin-right: 0.75rem;
  transition: color 0.2s ease;
}

.dd-category-card:hover .dd-category-icon {
  color: #fdba74;
}

.dd-category-title {
  color: #fdba74;
  font-weight: bold;
  font-size: 1.125rem;
  transition: color 0.2s ease;
}

.dd-category-card:hover .dd-category-title {
  color: #fed7aa;
}

.dd-category-count {
  color: #9ca3af;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Progress elements */
.dd-progress-bar {
  width: 100%;
  height: 0.5rem;
  background: #374151;
  border-radius: 9999px;
}

.dd-progress-fill {
  height: 0.5rem;
  background: linear-gradient(to right, #ea580c, #fb923c);
  border-radius: 9999px;
  transition: all 0.3s ease;
}

.dd-progress-container {
  position: relative;
  cursor: pointer;
}

.dd-progress-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  background: #ea580c;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.5);
  left: calc(var(--progress, 0%) - 0.5rem);
}

.dd-progress-container:hover .dd-progress-handle {
  opacity: 1;
}


/* Loading states */
.dd-loading {
  position: relative;
  overflow: hidden;
}

.dd-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(234, 88, 12, 0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Generic range slider styling - kept for potential future use */
input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  background: #374151;
  border-radius: 5px;
  outline: none;
  height: 8px;
}

input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ea580c;
  cursor: pointer;
  border: 2px solid #1f2937;
  transition: all 0.2s ease;
}

input[type="range"].slider::-webkit-slider-thumb:hover {
  background: #fb7c3c;
  transform: scale(1.1);
}

input[type="range"].slider::-moz-range-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ea580c;
  cursor: pointer;
  border: 2px solid #1f2937;
  transition: all 0.2s ease;
}

input[type="range"].slider::-moz-range-thumb:hover {
  background: #fb7c3c;
  transform: scale(1.1);
}

input[type="range"].slider::-moz-range-track {
  background: #374151;
  height: 8px;
  border-radius: 5px;
}

input[type="range"].slider::-moz-range-progress {
  background: #ea580c;
  height: 8px;
  border-radius: 5px;
}

/* Smooth transitions for all interactive elements */
button, select, input {
  transition: all 0.2s ease;
}

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

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

.fa-spin {
  animation: spin 1s linear infinite;
}

/* Low bandwidth mode adjustments */
.low-bandwidth img,
.low-bandwidth video {
  filter: grayscale(20%);
}

.low-bandwidth .transition-all {
  transition: none !important;
}

/* Mobile touch feedback */
@media (hover: none) {
  button:hover {
    transform: none;
  }
  
  button:active {
    transform: scale(0.98);
  }
}

/* Pulse animation for active buttons */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.animate-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #374151;
}

::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Ensure full height on mobile */
html, body {
  height: 100%;
  overflow-x: hidden;
}

/* Prevent text selection on UI elements */
button, .no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Mobile optimizations */
.touch-feedback {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(234, 88, 12, 0.3);
}

/* Better scrolling on mobile */
* {
  -webkit-overflow-scrolling: touch;
}

/* Improved focus states for accessibility */
@media (prefers-reduced-motion: no-preference) {
  button:focus,
  select:focus,
  input:focus {
    transition: outline-offset 0.15s ease;
    outline-offset: 4px;
  }
}

/* Audio loading states */
.audio-loading {
  position: relative;
  overflow: hidden;
}

.audio-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(234, 88, 12, 0.3), transparent);
  animation: audio-loading 1.5s infinite;
}

@keyframes audio-loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Notification animations */
.notification-enter {
  animation: slideInRight 0.3s ease-out;
}

.notification-exit {
  animation: slideOutRight 0.3s ease-in;
}

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

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

/* Animation classes */
.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

.animate-bounce-subtle {
  animation: bounceSubtle 0.6s ease-in-out;
}


@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes slideUp {
  0% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes bounceSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Hold button visual feedback */
.hold-active {
  transform: scale(1.05) !important;
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.6) !important;
}

/* Category popup styling */
.category-popup {
  animation: popupSlideUp 0.2s ease-out;
  z-index: 1000;
}

.category-popup .category-option {
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.category-popup .category-option:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* Circular category popup styling */
.category-popup-circular {
  animation: circularPopupAppear 0.3s ease-out;
  z-index: 1000;
  pointer-events: none; /* Allow clicks to pass through background */
}

.category-popup-circular .circular-popup-background {
  pointer-events: auto; /* Re-enable clicks on the circle */
}

.category-popup-circular .category-option-circular {
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.category-popup-circular .category-option-circular:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Active state for touch devices */
.category-popup-circular .category-option-circular:active {
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

@keyframes circularPopupAppear {
  0% { 
    opacity: 0; 
    transform: scale(0.3) rotate(-10deg); 
  }
  60% { 
    opacity: 1; 
    transform: scale(1.05) rotate(2deg); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1) rotate(0deg); 
  }
}

/* Visual feedback for categories */
.category-option.hover-highlight {
  background: rgba(234, 88, 12, 0.8) !important;
  border-color: #fb923c !important;
  transform: scale(1.1);
}

/* Prevent text selection during hold */
.no-select-on-hold {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Enhanced button states for hold functionality */
.dd-btn-success.hold-active {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.6) !important;
}

.dd-btn-danger.hold-active {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.6) !important;
}

/* Mobile touch feedback improvements */
@media (hover: none) and (pointer: coarse) {
  .category-popup {
    /* Larger touch targets and better spacing on mobile */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  
  .category-popup .category-option {
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    /* Improve touch responsiveness */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(234, 88, 12, 0.3);
  }
  
  /* Larger touch area for category options */
  .category-popup .category-option::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    z-index: -1;
  }
  
  /* Better visual feedback on touch */
  .category-popup .category-option:active {
    transform: scale(0.95);
    background: rgba(234, 88, 12, 0.8) !important;
  }
}

/* Performance optimization modes */
.low-battery-mode {
  /* Reduce animations and effects to save battery */
}

.low-battery-mode * {
  animation-duration: 0.1s !important;
  transition-duration: 0.1s !important;
}

.low-battery-mode .dd-audio-wave {
  display: none !important;
}

.slow-connection {
  /* Reduce visual complexity on slow connections */
}

.slow-connection .dd-card-hover:hover {
  transform: none !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.offline-mode {
  /* Visual indicators for offline state */
}

.offline-mode::before {
  content: 'OFFLINE';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #dc2626;
  color: white;
  text-align: center;
  padding: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 9999;
}

/* Viewport height fix for mobile browsers */
:root {
  --vh: 1vh;
}

.min-h-screen {
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
}

/* Better touch targets */
@media (hover: none) {
  button, [role="button"], .dd-btn-base {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Prevent text selection during touch interactions */
.category-popup,
.hold-active {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Enhanced touch feedback for buttons */
@media (hover: none) and (pointer: coarse) {
  .dd-btn-success:active,
  .dd-btn-danger:active {
    transform: scale(0.98);
  }
  
  .dd-btn-success.hold-active,
  .dd-btn-danger.hold-active {
    transform: scale(1.02) !important;
  }
}

/* Adaptive Wheel Menu Layouts */

/* Arc Layout (Semicircle) */
.category-popup-arc {
  animation: arcPopupAppear 0.3s ease-out;
  z-index: 1000;
  pointer-events: none;
}

.category-popup-arc .arc-popup-background {
  pointer-events: auto;
  background: rgba(31, 41, 55, 0.9);
  border: 3px solid;
  border-radius: 200px 200px 0 0; /* Top semicircle */
  box-shadow: 0 0 30px rgba(234, 88, 12, 0.3);
  position: relative;
}

.category-popup-arc.arc-bottom .arc-popup-background {
  border-radius: 0 0 200px 200px; /* Bottom semicircle */
}

.category-popup-arc.arc-left .arc-popup-background {
  border-radius: 200px 0 0 200px; /* Left semicircle */
}

.category-popup-arc.arc-right .arc-popup-background {
  border-radius: 0 200px 200px 0; /* Right semicircle */
}

.category-popup-arc .category-option-arc {
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.category-popup-arc .category-option-arc:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.category-popup-arc .category-option-arc:active {
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes arcPopupAppear {
  0% { 
    opacity: 0; 
    transform: scale(0.3); 
  }
  60% { 
    opacity: 1; 
    transform: scale(1.05); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1); 
  }
}

/* REMOVED: Linear and Stack layouts replaced with Rectangle layout */

/* Rectangle Grid Layout */
.category-popup-rectangle {
  animation: rectanglePopupFade 0.3s ease-out;
  z-index: 1000;
  pointer-events: none;
}

.category-popup-rectangle .rectangle-popup-background {
  pointer-events: auto;
  background: rgba(31, 41, 55, 0.9);
  border: 3px solid;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(234, 88, 12, 0.3);
  position: relative;
  display: grid;
  gap: 12px;
  padding: 20px;
  align-items: center;
  justify-items: center;
}

.category-popup-rectangle .category-option-rectangle {
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.category-popup-rectangle .category-option-rectangle:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.category-popup-rectangle .category-option-rectangle:active {
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes rectanglePopupFade {
  0% { 
    opacity: 0; 
    transform: scale(0.9); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1); 
  }
}

/* Close button for adaptive layouts */
.adaptive-close-button {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  font-size: 12px;
  z-index: 10;
}

.adaptive-close-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(220, 38, 38, 0.4);
}

.adaptive-close-button:active {
  transform: scale(0.95);
}

/* Carousel Component Styles */
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.carousel-slides {
  display: flex;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.carousel-slide {
  width: 100%;
  flex-shrink: 0;
  min-height: 0; /* Allow natural height */
}

/* Carousel Indicators */
.carousel-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #6b7280;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-indicator.active {
  background-color: #ea580c;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(234, 88, 12, 0.6);
}

.carousel-indicator:hover:not(.active) {
  background-color: #9ca3af;
  transform: scale(1.1);
}

/* Touch-friendly drag cursor */
.carousel-container:active .carousel-slides {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}

/* Desktop Arrow Navigation */
.carousel-arrow {
  background: rgba(31, 41, 55, 0.9);
  border: 2px solid #374151;
  backdrop-filter: blur(4px);
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-arrow:hover {
  background: rgba(55, 65, 81, 0.95);
  border-color: #ea580c;
  color: #fed7aa;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(234, 88, 12, 0.3);
}

.carousel-arrow:active {
  transform: scale(1.05);
}

.carousel-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hide arrows on mobile to avoid interference with touch */
@media (hover: none) and (pointer: coarse) {
  .carousel-arrow {
    display: none !important;
  }
}

.carousel-slides {
  cursor: grab;
  cursor: -webkit-grab;
}

/* Disable grab cursor on desktop when arrows are present */
@media (min-width: 768px) {
  .carousel-slides {
    cursor: default;
  }
  
  .carousel-container:active .carousel-slides {
    cursor: default;
  }
}

/* Settings Popup Styles */
.settings-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.settings-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.settings-popup {
  background: rgba(31, 41, 55, 0.95);
  border: 2px solid #ea580c;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.3s ease;
}

.settings-popup-overlay.active .settings-popup {
  transform: scale(1) translateY(0);
}

.settings-popup-header {
  padding: 1.5rem;
  border-bottom: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-popup-title {
  color: #fed7aa;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-popup-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.settings-popup-close:hover {
  color: #fed7aa;
  background: rgba(156, 163, 175, 0.1);
}

.settings-popup-content {
  padding: 1.5rem;
}

.settings-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid #374151;
}

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

.settings-option-label {
  color: #fed7aa;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-option-description {
  color: #9ca3af;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.settings-toggle-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #374151;
  color: #9ca3af;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-toggle-button.active {
  background: #ea580c;
  border-color: #ea580c;
  color: white;
}

.settings-toggle-button:hover {
  border-color: #ea580c;
  color: #fed7aa;
}

.settings-toggle-button.active:hover {
  background: #f97316;
}

/* Toggle Switch Style */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #374151;
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid #4b5563;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #9ca3af;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #ea580c;
  border-color: #ea580c;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(26px);
  background-color: white;
}

.toggle-slider:hover {
  border-color: #ea580c;
}

.settings-toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-toggle-label {
  font-size: 0.875rem;
  color: #9ca3af;
  transition: color 0.2s ease;
}

.settings-toggle-container.active .settings-toggle-label {
  color: #fed7aa;
}


/* Prevent image drag */
.carousel-slide img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* Mobile-specific optimizations */
@media (hover: none) and (pointer: coarse) {
  .carousel-container {
    /* Allow both horizontal and vertical touch actions */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  .carousel-indicator {
    /* Larger touch targets for mobile */
    width: 12px;
    height: 12px;
    margin: 0 4px;
  }
  
  .carousel-slides {
    /* Disable grab cursor on touch devices */
    cursor: default;
  }
  
  .carousel-container:active .carousel-slides {
    cursor: default;
  }
}

/* Smooth scrolling fallback for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .carousel-slides {
    transition: transform 0.1s ease-out;
  }
  
  .carousel-indicator {
    transition: all 0.1s ease;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .carousel-indicator {
    border: 2px solid currentColor;
    background-color: transparent;
  }
  
  .carousel-indicator.active {
    background-color: currentColor;
  }
}

/* RTL support */
[dir="rtl"] .carousel-slides {
  direction: rtl;
}

[dir="rtl"] .carousel-slide {
  direction: ltr;
}

/* Section Carousel Indicators */
.section-indicator {
  background-color: rgba(31, 41, 55, 0.8);
  border: 1px solid #374151;
  color: #9ca3af;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  justify-content: center;
  cursor: pointer;
}

.section-indicator.active {
  background-color: rgba(234, 88, 12, 0.9);
  border-color: #ea580c;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.4);
}

.section-indicator:hover:not(.active) {
  background-color: rgba(55, 65, 81, 0.9);
  border-color: #6b7280;
  color: #d1d5db;
  transform: scale(1.02);
}

/* Consistent round indicators for all screen sizes */
.section-indicator {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.section-indicator i {
  font-size: 1.125rem;
}


/* Mobile optimizations for section indicators */
@media (hover: none) and (pointer: coarse) {
  .section-indicator {
    /* Larger touch targets for mobile */
    min-height: 48px;
    padding: 12px 16px;
  }
  
  .section-indicator:active {
    transform: scale(0.98);
  }
  
  .section-indicator.active:active {
    transform: scale(1.02);
  }
}

/* Layout Switching Animations */
[data-layout="carousel"],
[data-layout="stacked"] {
  transition: opacity 0.3s ease-in-out;
}

[data-layout="carousel"][style*="display: none"],
[data-layout="stacked"][style*="display: none"] {
  opacity: 0;
}

/* Settings Toggle Styling */
.settings-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-toggle-label {
  font-size: 0.75rem;
  color: #9ca3af;
  white-space: nowrap;
}

/* Ensure stacked layout sections have proper spacing */
[data-layout="stacked"] section {
  margin-bottom: 1.5rem;
}

[data-layout="stacked"] section:last-child {
  margin-bottom: 0;
}