/**
 * Purple Glow Theme - Enhanced Tile Styling
 * 
 * This file contains the enhanced styling system with purple glow effects,
 * rounded tiles, and inner tiles that can be used across all partials and pages.
 * 
 * Usage: Add <link rel="stylesheet" href="/css/purple-glow-theme.css"> to your HTML
 */

/* ============================================
   ENHANCED TILE STYLING - Main Cards/Tiles
   ============================================ */

/* Enhanced tile styling - more rounded corners and white light sparkle effect */
.card {
  border-radius: 1.5rem !important; /* More rounded corners (from 1rem to 1.5rem) */
  border: 1px solid rgba(255, 255, 255, 0.22) !important; /* Slightly brighter border */
  box-shadow: 
    0 8px 32px 0 rgba(0, 0, 0, 0.37),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 2px rgba(255, 255, 255, 0.1) inset !important; /* Enhanced shadow with white glow */
  position: relative;
}

/* Enhanced white light sparkle effect on top */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 20%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.3) 80%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Additional sparkle effect with subtle shine overlay */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.03) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.02) 100%);
  pointer-events: none;
  border-radius: 1.5rem;
  z-index: 0;
}

/* Enhanced hover effect */
.card:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 
    0 12px 40px 0 rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;
  transform: translateY(-2px);
}

/* Enhanced sparkle on hover */
.card:hover::before {
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.4) 20%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.4) 80%,
    transparent 100%);
  height: 3px;
}

/* ============================================
   INNER TILES - Elements within Cards
   ============================================ */

/* Inner tile styling - for elements inside cards */
.inner-tile {
  position: relative;
  background: rgba(14, 21, 48, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 16px 0 rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inner-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.inner-tile:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 6px 20px 0 rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transform: translateY(-1px);
}

/* Smaller inner tiles for compact spaces */
.inner-tile-small {
  position: relative;
  background: rgba(14, 21, 48, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 
    0 2px 8px 0 rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.inner-tile-small:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 4px 12px 0 rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

/* ============================================
   PURPLE GLOW EFFECTS
   ============================================ */

/* Main card with purple glow effect */
.purple-glow-card {
  position: relative;
  overflow: hidden;
}

/* Flowing glowing purple-blue effect at the top */
.purple-glow-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: 
    radial-gradient(ellipse at top, 
      rgba(99, 102, 241, 0.15) 0%,
      rgba(139, 92, 246, 0.12) 30%,
      rgba(168, 85, 247, 0.08) 50%,
      transparent 100%),
    linear-gradient(180deg, 
      rgba(79, 70, 229, 0.1) 0%,
      rgba(99, 102, 241, 0.08) 20%,
      rgba(139, 92, 246, 0.05) 40%,
      transparent 70%);
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

/* Ensure header and content are above the background overlay */
.purple-glow-card > header,
.purple-glow-card > div {
  position: relative;
  z-index: 1;
}

/* Purple glow on hover for cards */
.card.purple-glow:hover {
  box-shadow: 
    0 12px 40px 0 rgba(0, 0, 0, 0.5),
    0 0 30px rgba(139, 92, 246, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;
}

/* Purple glow inner tiles */
.inner-tile.purple-glow {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 
    0 4px 16px 0 rgba(0, 0, 0, 0.25),
    0 0 20px rgba(139, 92, 246, 0.2),
    0 0 0 1px rgba(139, 92, 246, 0.1) inset;
}

.inner-tile.purple-glow:hover {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 
    0 6px 20px 0 rgba(0, 0, 0, 0.35),
    0 0 30px rgba(139, 92, 246, 0.3),
    0 0 0 1px rgba(139, 92, 246, 0.15) inset;
}

/* ============================================
   PILLOW-STYLE BADGES
   ============================================ */

/* Pillow-style badge for "Enter competitor URL" and similar large badges */
.pillow-badge {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.9) 0%,
    rgba(37, 99, 235, 0.95) 50%,
    rgba(29, 78, 216, 0.9) 100%);
  border-radius: 2rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 8px 24px rgba(59, 130, 246, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  transform: perspective(1000px) rotateX(2deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pillow-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, 
    rgba(255, 255, 255, 0.15) 0%,
    transparent 70%);
  animation: pillow-shimmer 3s ease-in-out infinite;
}

.pillow-badge::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 40%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 100%);
  border-radius: 50%;
  pointer-events: none;
}

@keyframes pillow-shimmer {
  0%, 100% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translate(-40%, -40%) rotate(180deg);
    opacity: 0.6;
  }
}

.pillow-badge:hover {
  transform: perspective(1000px) rotateX(0deg) translateY(-2px);
  box-shadow: 
    0 12px 32px rgba(59, 130, 246, 0.4),
    0 6px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.pillow-badge span {
  position: relative;
  z-index: 1;
}

/* Smaller pillow-style badge for theme name and other elements */
.pillow-badge-small {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, 
    rgba(16, 185, 129, 0.85) 0%,
    rgba(6, 182, 212, 0.9) 50%,
    rgba(59, 130, 246, 0.85) 100%);
  border-radius: 1.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 6px 20px rgba(16, 185, 129, 0.25),
    0 3px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  transform: perspective(1000px) rotateX(1deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pillow-badge-small::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, 
    rgba(255, 255, 255, 0.12) 0%,
    transparent 70%);
  animation: pillow-shimmer 3s ease-in-out infinite;
}

.pillow-badge-small::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 40%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.18) 0%,
    transparent 100%);
  border-radius: 50%;
  pointer-events: none;
}

.pillow-badge-small:hover {
  transform: perspective(1000px) rotateX(0deg) translateY(-1px);
  box-shadow: 
    0 8px 24px rgba(16, 185, 129, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.1);
}

.pillow-badge-small span {
  position: relative;
  z-index: 1;
}

/* Pillow-style badge for text elements */
.pillow-badge-text {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.9) 0%,
    rgba(37, 99, 235, 0.95) 50%,
    rgba(29, 78, 216, 0.9) 100%);
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 4px 16px rgba(59, 130, 246, 0.3),
    0 2px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 4px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  transform: perspective(800px) rotateX(1deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pillow-badge-text::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, 
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%);
  animation: pillow-shimmer 4s ease-in-out infinite;
}

.pillow-badge-text:hover {
  transform: perspective(800px) rotateX(0deg) translateY(-1px);
  box-shadow: 
    0 6px 20px rgba(59, 130, 246, 0.4),
    0 3px 10px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 4px rgba(0, 0, 0, 0.08);
}

.pillow-badge-text span {
  position: relative;
  z-index: 1;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

/* Custom scrollbar for theme gallery and store structure */
.theme-gallery-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

.theme-gallery-scroll::-webkit-scrollbar {
  width: 8px;
}

.theme-gallery-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.theme-gallery-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.theme-gallery-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
  background-clip: padding-box;
}

/* ============================================
   NICHE SELECTION BUTTONS
   ============================================ */

.niche-select-btn {
  min-width: 120px;
}

.niche-select-btn.selected {
  border-color: rgba(59, 130, 246, 0.8) !important;
  background: rgba(59, 130, 246, 0.15) !important;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.niche-select-btn.selected i {
  color: rgba(59, 130, 246, 1) !important;
}

.niche-select-btn.selected span {
  color: rgba(255, 255, 255, 1) !important;
  font-weight: 600;
}

/* ============================================
   PRODUCT TILES (if needed)
   ============================================ */

/* Winning product tiles */
.winning-product-tile {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.winning-product-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.product-tile-image {
  position: relative;
  width: 100%;
  height: 200px;
  background: #f3f4f6;
  overflow: hidden;
}

.product-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-tile-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #ffffff;
  border: 1px solid #ec4899;
  border-radius: 0.375rem;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #000000;
  font-weight: 500;
}

.product-tile-badge i {
  color: #ef4444;
  font-size: 10px;
}

.product-tile-content {
  position: relative;
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.product-tile-name {
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  margin-bottom: 8px;
}

.product-tile-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.product-tile-price {
  font-size: 24px;
  font-weight: 700;
  color: #ec4899;
}

.product-tile-sales-label {
  font-size: 12px;
  color: #6b7280;
}

.product-tile-button {
  width: 100%;
  background: #ec4899;
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: auto;
  transition: background 0.2s ease;
}

.product-tile-button:hover {
  background: #db2777;
}

/* ============================================
   CALENDAR - Add Event modal
   ============================================ */

/* Add Event popup: content-sized, never full screen */
#event-modal-dialog.event-modal-dialog,
.event-modal-dialog {
  width: 28rem !important;
  max-width: calc(100vw - 2rem) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  flex-shrink: 0 !important;
  align-self: center !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Apply purple glow to any element */
.has-purple-glow {
  box-shadow: 
    0 0 20px rgba(139, 92, 246, 0.3),
    0 0 40px rgba(139, 92, 246, 0.2) !important;
}

/* Purple accent border */
.purple-border {
  border-color: rgba(139, 92, 246, 0.4) !important;
}

/* Purple background tint */
.purple-bg-tint {
  background: rgba(139, 92, 246, 0.1) !important;
}

/* Purple text accent */
.text-purple-glow {
  color: rgba(168, 85, 247, 1);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}
