/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Import Flag Icons CSS */
@import url('https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.2.3/css/flag-icons.min.css');

/* Pending Match Indicator */
body.has-pending-matches::after {
  content: '🎉';
  position: fixed;
  top: 80px;
  right: 20px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: pulse 1.5s infinite;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

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

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

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

/* Smooth synopsis expansion animation */
.synopsis-content {
  transition: all 0.3s ease-in-out;
}

.synopsis-content:hover .synopsis-hint {
  opacity: 1;
}

/* Custom scrollbar for synopsis */
.synopsis-scroll {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db #f9fafb;
}

.synopsis-scroll::-webkit-scrollbar {
  width: 4px;
}

.synopsis-scroll::-webkit-scrollbar-track {
  background: #f9fafb;
  border-radius: 2px;
}

.synopsis-scroll::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 2px;
}

.synopsis-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

/* Custom Range Slider Styles for Flowbite */
.range-purple {
  -webkit-appearance: none;
  appearance: none;
  background: #e5e7eb;
  border-radius: 6px;
  height: 8px;
  outline: none;
  transition: background 0.2s ease;
}

.range-purple::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: #7c3aed;
  border-radius: 50%;
  cursor: pointer;
  height: 20px;
  width: 20px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.3);
  transition: all 0.2s ease;
}

.range-purple::-webkit-slider-thumb:hover {
  background: #6d28d9;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(124, 58, 237, 0.4);
}

.range-purple::-moz-range-thumb {
  background: #7c3aed;
  border-radius: 50%;
  cursor: pointer;
  height: 20px;
  width: 20px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.3);
  transition: all 0.2s ease;
  -moz-appearance: none;
}

.range-purple::-moz-range-thumb:hover {
  background: #6d28d9;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(124, 58, 237, 0.4);
}

/* Focus styles for accessibility */
.range-purple:focus {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* Selected content type buttons */
.content-type-selected {
  @apply bg-purple-600 text-white border-purple-600;
}

.content-type-selected:hover {
  @apply bg-purple-700 border-purple-700;
}

/* Accordion transition improvements */
[data-accordion-content] {
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Safe area support for mobile devices */
.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-left {
  padding-left: env(safe-area-inset-left);
}

.safe-area-right {
  padding-right: env(safe-area-inset-right);
}

/* Full-screen swipe layout */
.swipe-container {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
}

/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
  .slider-purple::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
  }
  
  .slider-purple::-moz-range-thumb {
    height: 24px;
    width: 24px;
  }
  
  /* Larger touch targets for buttons */
  button[data-content-type],
  button[data-decade] {
    min-height: 44px;
    touch-action: manipulation;
  }
  
  /* Improved touch targets for swipe buttons */
  .swipe-action-button {
    min-width: 56px;
    min-height: 56px;
    touch-action: manipulation;
  }
}
