/**
 * CUSTOM CSS ICONS
 * Beautiful, theme-aware icons with smooth animations
 * Perfectly integrated with the romantic theme system
 */

/* Base CSS Icon Styles */
.css-icon {
  width: 48px;
  height: 48px;
  position: relative;
  display: inline-block;
  margin: 0 auto;
}

/* ============================================================================
   HOURGLASS ICON - For Countdown
   Classic hourglass shape with sand falling and flipping animation
   ============================================================================ */

.css-hourglass {
  position: relative;
  width: 36px;
  height: 40px;
  animation: hourglassFlip 8s ease-in-out infinite;
}

/* Hourglass outline - classic shape */
.css-hourglass::before {
  content: '';
  position: absolute;
  width: 36px;
  height: 40px;
  left: 0;
  top: 0;
  border: 2px solid var(--card-text-primary);
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 40%, 60% 40%, 50% 50%, 60% 60%, 100% 60%, 100% 100%, 
    0% 100%, 0% 60%, 40% 60%, 50% 50%, 40% 40%, 0% 40%
  );
  background: transparent;
}

/* Top sand chamber */
.css-hourglass::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 14px;
  background: var(--card-text-primary);
  left: 3px;
  top: 2px;
  animation: topSandDrain 8s ease-in-out infinite;
}

/* Bottom sand using box-shadow */
.css-hourglass::after {
  box-shadow: 0 22px 0 0 transparent;
}

/* Sand draining animation */
@keyframes topSandDrain {
  0% { 
    height: 14px;
    box-shadow: 0 22px 0 0 transparent;
  }
  45% { 
    height: 2px;
    box-shadow: 0 22px 0 0 var(--card-text-primary);
  }
  50% { 
    height: 0px;
    box-shadow: 0 22px 0 0 var(--card-text-primary);
  }
  55% {
    height: 0px;
    box-shadow: 0 22px 0 0 var(--card-text-primary);
  }
  100% { 
    height: 14px;
    box-shadow: 0 22px 0 0 transparent;
  }
}

/* Hourglass flip animation */
@keyframes hourglassFlip {
  0%, 48% { 
    transform: rotate(0deg) scale(1);
  }
  50%, 52% { 
    transform: rotate(180deg) scale(1.1);
  }
  100% { 
    transform: rotate(360deg) scale(1);
  }
}

/* ============================================================================
   PUZZLE ICON - For Question of the Day
   Interlocking puzzle pieces representing connection
   ============================================================================ */

.css-puzzle {
  position: relative;
}

.css-puzzle::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--card-text-primary);
  border-radius: 4px;
  top: 8px;
  left: 8px;
  clip-path: polygon(
    0% 0%, 70% 0%, 70% 30%, 100% 30%, 100% 70%, 70% 70%, 70% 100%, 
    30% 100%, 30% 70%, 0% 70%
  );
}

.css-puzzle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--card-text-primary);
  border-radius: 4px;
  top: 20px;
  right: 8px;
  clip-path: polygon(
    30% 0%, 100% 0%, 100% 30%, 70% 30%, 70% 70%, 100% 70%, 100% 100%, 
    0% 100%, 0% 70%, 30% 70%
  );
  opacity: 0.8;
}

/* Puzzle connection animation */
.css-puzzle {
  animation: puzzleConnect 2s ease-in-out infinite;
}

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

.css-puzzle::before {
  animation: puzzlePiece1 2s ease-in-out infinite;
}

.css-puzzle::after {
  animation: puzzlePiece2 2s ease-in-out infinite 0.3s;
}

@keyframes puzzlePiece1 {
  0%, 100% { 
    transform: translateX(0) translateY(0);
  }
  50% { 
    transform: translateX(2px) translateY(-1px);
  }
}

@keyframes puzzlePiece2 {
  0%, 100% { 
    transform: translateX(0) translateY(0);
  }
  50% { 
    transform: translateX(-2px) translateY(1px);
  }
}

/* ============================================================================
   BEATING HEART ICON - For Send I Miss You
   Realistic beating heart with love waves
   ============================================================================ */

.css-heart-pulse {
  position: relative;
  animation: heartBeat 1.2s ease-in-out infinite;
}

/* Left heart lobe */
.css-heart-pulse::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 18px;
  background: var(--card-text-primary);
  left: 14px;
  top: 10px;
  border-radius: 10px 10px 0 0;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
  animation: heartBeat 1.2s ease-in-out infinite;
}

/* Right heart lobe */
.css-heart-pulse::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 18px;
  background: var(--card-text-primary);
  left: 14px;
  top: 10px;
  border-radius: 10px 10px 0 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
  animation: heartBeat 1.2s ease-in-out infinite;
}

/* Realistic heartbeat animation */
@keyframes heartBeat {
  0% { 
    transform: scale(1);
    filter: brightness(1);
  }
  14% { 
    transform: scale(1.15);
    filter: brightness(1.1);
  }
  28% { 
    transform: scale(1);
    filter: brightness(1);
  }
  42% { 
    transform: scale(1.25);
    filter: brightness(1.2);
  }
  70% { 
    transform: scale(1);
    filter: brightness(1);
  }
  100% { 
    transform: scale(1);
    filter: brightness(1);
  }
}

/* Individual lobe animations for more realistic beat */
.css-heart-pulse::before {
  animation: heartBeatLeft 1.2s ease-in-out infinite;
}

.css-heart-pulse::after {
  animation: heartBeatRight 1.2s ease-in-out infinite;
}

@keyframes heartBeatLeft {
  0% { 
    transform: rotate(-45deg) scale(1);
  }
  14% { 
    transform: rotate(-45deg) scale(1.1);
  }
  28% { 
    transform: rotate(-45deg) scale(1);
  }
  42% { 
    transform: rotate(-45deg) scale(1.2);
  }
  70% { 
    transform: rotate(-45deg) scale(1);
  }
  100% { 
    transform: rotate(-45deg) scale(1);
  }
}

@keyframes heartBeatRight {
  0% { 
    transform: rotate(45deg) scale(1);
  }
  14% { 
    transform: rotate(45deg) scale(1.1);
  }
  28% { 
    transform: rotate(45deg) scale(1);
  }
  42% { 
    transform: rotate(45deg) scale(1.2);
  }
  70% { 
    transform: rotate(45deg) scale(1);
  }
  100% { 
    transform: rotate(45deg) scale(1);
  }
}

/* Love waves effect */
.css-heart-pulse {
  position: relative;
}

.css-heart-pulse::before,
.css-heart-pulse::after {
  box-shadow: 
    0 0 0 2px rgba(255, 255, 255, 0.1),
    0 0 0 4px rgba(255, 255, 255, 0.05);
}

/* Enhanced love waves on heartbeat */
.css-heart-pulse {
  position: relative;
}

.css-heart-pulse::before::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: loveWaves 2.4s ease-out infinite;
}

@keyframes loveWaves {
  0% {
    width: 20px;
    height: 20px;
    opacity: 0.8;
  }
  70% {
    width: 60px;
    height: 60px;
    opacity: 0.2;
  }
  100% {
    width: 80px;
    height: 80px;
    opacity: 0;
  }
}

/* ============================================================================
   HOVER EFFECTS FOR ALL ICONS
   Enhanced interactions on card hover
   ============================================================================ */

.activity-card:hover .css-hourglass {
  animation-duration: 4s;
  transform: scale(1.1);
}

.activity-card:hover .css-puzzle {
  animation-duration: 1s;
}

.activity-card:hover .css-heart-pulse {
  animation-duration: 0.6s;
}

.activity-card:hover .css-heart-pulse::before,
.activity-card:hover .css-heart-pulse::after {
  animation-duration: 0.6s;
}

/* ============================================================================
   RESPONSIVE DESIGN
   Proper scaling for mobile devices
   ============================================================================ */

@media (max-width: 768px) {
  .css-icon {
    width: 40px;
    height: 40px;
  }
  
  .css-hourglass::before,
  .css-hourglass::after {
    width: 32px;
    height: 16px;
    left: 4px;
  }
  
  .css-puzzle::before,
  .css-puzzle::after {
    width: 16px;
    height: 16px;
  }
  
  .css-puzzle::before {
    top: 6px;
    left: 6px;
  }
  
  .css-puzzle::after {
    top: 18px;
    right: 6px;
  }
  
  .css-heart-pulse::before,
  .css-heart-pulse::after {
    width: 20px;
    height: 18px;
    left: 10px;
    top: 11px;
  }
}

@media (max-width: 480px) {
  .css-icon {
    width: 36px;
    height: 36px;
  }
}

/* ============================================================================
   THEME TRANSITIONS
   Smooth color transitions when themes change
   ============================================================================ */

.css-icon,
.css-icon::before,
.css-icon::after {
  transition: all 0.6s ease;
}
