/* Mobile-Optimized Filters and Cards */

/* Search and Filter Container */
.mobile-search-container {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: sticky;
  top: 10px;
  z-index: 0;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .mobile-search-container {
  background: rgba(26, 26, 26, 0);
}

/* Search Input Group */
.mobile-search-group {
  position: relative;
  margin-bottom: 1rem;
}

.mobile-search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3.5rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
  min-height: 48px;
}

.mobile-search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  transform: translateY(-1px);
}

.mobile-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.2rem;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.mobile-search-input:focus + .mobile-search-icon {
  color: var(--primary-color);
}

.mobile-search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all var(--transition-fast);
  opacity: 0;
  visibility: hidden;
}

.mobile-search-input:not(:placeholder-shown) + .mobile-search-icon + .mobile-search-clear {
  opacity: 1;
  visibility: visible;
}

.mobile-search-clear:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Filter Dropdown */
.mobile-filter-group {
  position: relative;
}

.mobile-filter-select {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  min-height: 48px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 3rem;
}

.mobile-filter-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  outline: none;
}

/* Filter Tags */
.mobile-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  min-height: 2rem;
}

.mobile-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.mobile-filter-tag-remove {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.mobile-filter-tag-remove:hover {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Results Counter */
.mobile-results-counter {
  text-align: center;
  margin: 1rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-radius: 20px;
  display: inline-block;
}

/* Cards Grid */
.mobile-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 576px) {
  .mobile-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .mobile-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1200px) {
  .mobile-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

/* Enhanced Edition Cards */
.mobile-edition-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.mobile-edition-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.mobile-edition-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
  z-index: 1;
}

.mobile-edition-card:hover::before {
  left: 100%;
}

/* Card Image Container */
.mobile-card-image-container {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.mobile-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.mobile-edition-card:hover .mobile-card-image {
  transform: scale(1.05);
}

.mobile-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.mobile-edition-card:hover .mobile-card-overlay {
  opacity: 1;
}

/* Card Badge */
.mobile-card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Card Year Badge */
.mobile-card-year {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition-normal);
}

.mobile-edition-card:hover .mobile-card-year {
  opacity: 1;
  transform: translateY(0);
}

/* Card Content */
.mobile-card-content {
  padding: 1.5rem;
  position: relative;
  z-index: 2;
}

.mobile-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Actions */
.mobile-card-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.mobile-card-button {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.mobile-card-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.mobile-card-button:active::before {
  width: 300px;
  height: 300px;
}

.mobile-card-button-primary {
  background: var(--primary-color);
  color: white;
}

.mobile-card-button-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.mobile-card-button-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 0.5rem;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.mobile-card-button-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

/* Loading States */
.mobile-card-loading {
  pointer-events: none;
}

.mobile-card-loading .mobile-card-image {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.mobile-card-loading .mobile-card-title,
.mobile-card-loading .mobile-card-description {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  color: transparent;
  border-radius: 4px;
}

/* Empty State */
.mobile-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.mobile-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.mobile-empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.mobile-empty-description {
  font-size: 1rem;
  margin-bottom: 2rem;
}

.mobile-empty-action {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-empty-action:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .mobile-search-container {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }
  
  .mobile-cards-grid {
    gap: 1rem;
  }
  
  .mobile-card-content {
    padding: 1rem;
  }
  
  .mobile-card-title {
    font-size: 1.125rem;
  }
  
  .mobile-card-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .mobile-card-button {
    width: 100%;
  }
  
  .mobile-card-button-secondary {
    width: 100%;
    border-radius: 10px;
    padding: 0.75rem 1rem;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .mobile-edition-card {
    border: 2px solid var(--text-primary);
  }
  
  .mobile-card-button {
    border: 2px solid currentColor;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mobile-edition-card,
  .mobile-card-image,
  .mobile-card-button,
  .mobile-card-overlay,
  .mobile-card-year {
    transition: none !important;
    animation: none !important;
  }
  
  .mobile-edition-card:hover {
    transform: none;
  }
  
  .mobile-edition-card:hover .mobile-card-image {
    transform: none;
  }
}

/* Print styles */
@media print {
  .mobile-search-container {
    display: none;
  }
  
  .mobile-cards-grid {
    display: block;
  }
  
  .mobile-edition-card {
    break-inside: avoid;
    margin-bottom: 1rem;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .mobile-card-actions {
    display: none;
  }
}

