/**
 * Colors Page Styles
 * Custom animations and color card effects
 */

/* Gradient Text Animation */
.hero-gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  display: inline-block;
  position: relative;
}

@supports not (-webkit-background-clip: text) {
  .hero-gradient-text {
    color: #a855f7;
    background: none;
    -webkit-text-fill-color: initial;
  }
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Color Card Effects */
.color-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

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

.color-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
}

.color-card:active {
  transform: translateY(-4px) scale(1.01);
}

.color-sample {
  width: 100%;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.color-card:hover .color-sample {
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  bottom: -50%;
  left: -50%;
  background: linear-gradient(to bottom, rgba(229, 231, 235, 0) 0%, rgba(229, 231, 235, 0.3) 50%, rgba(229, 231, 235, 0) 100%);
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.color-card:hover::after {
  opacity: 0.15;
}

/* Color Modal */
.color-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.color-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.color-modal.active .modal-content {
  transform: scale(1);
}

/* Dropdown Animations */
.dropdown-menu-content {
  animation: fadeIn 0.2s ease-out;
}

.dropdown-menu-content.hidden {
  animation: fadeOut 0.2s ease-out;
}

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

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

/* Filter Options */
.filter-option {
  color: #333;
}

.filter-option.active {
  background-color: #3b82f6;
  color: white;
}

.filter-option.active:hover {
  background-color: #2563eb;
}

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

/* Responsive Grid */
@media (max-width: 768px) {
  .modal-content {
    margin: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .filter-dropdown-btn {
    min-width: auto;
    width: 100%;
  }

  .dropdown-menu-content {
    left: 0;
    right: 0;
    min-width: auto;
  }

  #colorsGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .hero-gradient-text {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-section h1 {
    font-size: 2.5rem;
    line-height: 1.1;
  }

  .hero-section p {
    font-size: 1.125rem;
  }
}

@media (min-width: 640px) {
  #colorsGrid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

@media (min-width: 768px) {
  #colorsGrid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1024px) {
  #colorsGrid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 1280px) {
  #colorsGrid {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (min-width: 1536px) {
  #colorsGrid {
    grid-template-columns: repeat(10, 1fr);
  }
}

/* Print Styles */
@media print {
  .hero-section,
  .sticky,
  .color-modal,
  button {
    display: none !important;
  }

  .color-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #colorsGrid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .color-card,
  .color-modal,
  .modal-content,
  .dropdown-menu-content {
    animation: none;
    transition: none;
  }

  .color-card:hover {
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
  .color-card {
    border: 2px solid #000;
  }

  .hero-gradient-text {
    background: none;
    -webkit-text-fill-color: initial;
    color: #000;
  }
}

