/* ==========================================================================
   ANALYTICS & VISITOR TRACKING STYLES
   Beautiful, romantic visitor statistics display
   ========================================================================== */

/* Analytics Section - normal flow after love note button */
.analytics-section {
  width: 100%;
  max-width: 450px;
  margin-top: var(--spacing-lg);
  text-align: center;
}

/* Sweet Message Styling */
.sweet-message {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(15px);
  border-radius: 24px;
  padding: var(--spacing-lg) var(--spacing-xl);
  border: none;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .analytics-section {
    max-width: 90%;
  }
  
  .sweet-message {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 20px;
  }
  
  .message-text {
    font-size: 0.95em;
  }
}

.sweet-message:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sweet-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  pointer-events: none;
}

.message-text {
  font-family: var(--font-primary);
  font-size: 1.05em;
  color: rgba(255, 255, 255, 0.95);
  font-style: italic;
  line-height: 1.5;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Visit Stats Container */
.visit-stats {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

/* Single user display centering */
.visit-stats .stat-item {
  margin: 0 auto;
}

/* Individual Stat Items */
.stat-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: var(--spacing-lg) var(--spacing-md);
  border: none;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-width: 140px;
  flex: 1;
  max-width: 220px;
  position: relative;
  overflow: hidden;
}

.stat-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Beautiful shimmer effect */
.stat-item::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.8s ease;
}

.stat-item:hover::before {
  left: 100%;
}

.stat-user {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.2em;
  color: white;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.stat-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  position: relative;
  z-index: 2;
}

.today-visits {
  font-family: var(--font-primary);
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.total-visits {
  font-family: var(--font-primary);
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Love Insight */
.love-insight {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  margin-top: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.love-insight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
  pointer-events: none;
}

.insight-text {
  font-family: var(--font-primary);
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
  text-align: center;
}

/* Theme-specific styling */
[data-theme="wholesome"] .stat-item {
  background: linear-gradient(135deg, rgba(255, 192, 203, 0.15) 0%, rgba(255, 182, 193, 0.1) 100%);
  box-shadow: 
    0 8px 32px rgba(255, 192, 203, 0.1),
    inset 0 1px 0 rgba(255, 192, 203, 0.2);
}

[data-theme="wholesome"] .stat-item:hover {
  box-shadow: 
    0 15px 40px rgba(255, 192, 203, 0.25),
    inset 0 1px 0 rgba(255, 192, 203, 0.3);
}

[data-theme="wholesome"] .stat-user {
  color: #fff5f5;
  text-shadow: 0 2px 4px rgba(255, 192, 203, 0.3);
}

[data-theme="missing"] .stat-item {
  background: linear-gradient(135deg, rgba(135, 206, 250, 0.15) 0%, rgba(173, 216, 230, 0.1) 100%);
  box-shadow: 
    0 8px 32px rgba(135, 206, 250, 0.1),
    inset 0 1px 0 rgba(135, 206, 250, 0.2);
}

[data-theme="missing"] .stat-item:hover {
  box-shadow: 
    0 15px 40px rgba(135, 206, 250, 0.25),
    inset 0 1px 0 rgba(135, 206, 250, 0.3);
}

[data-theme="missing"] .stat-user {
  color: #e6f2ff;
  text-shadow: 0 2px 4px rgba(135, 206, 250, 0.3);
}

[data-theme="horny"] .stat-item {
  background: linear-gradient(135deg, rgba(255, 69, 108, 0.15) 0%, rgba(255, 105, 135, 0.1) 100%);
  box-shadow: 
    0 8px 32px rgba(255, 69, 108, 0.1),
    inset 0 1px 0 rgba(255, 69, 108, 0.2);
}

[data-theme="horny"] .stat-item:hover {
  box-shadow: 
    0 15px 40px rgba(255, 69, 108, 0.25),
    inset 0 1px 0 rgba(255, 69, 108, 0.3);
}

[data-theme="horny"] .stat-user {
  color: #fff0f5;
  text-shadow: 0 2px 4px rgba(255, 69, 108, 0.3);
}

/* Theme-specific sweet message styling */
[data-theme="wholesome"] .sweet-message {
  background: linear-gradient(135deg, rgba(255, 192, 203, 0.15) 0%, rgba(255, 182, 193, 0.1) 100%);
  box-shadow: 
    0 8px 32px rgba(255, 192, 203, 0.1),
    inset 0 1px 0 rgba(255, 192, 203, 0.2);
}

[data-theme="wholesome"] .sweet-message:hover {
  box-shadow: 
    0 12px 40px rgba(255, 192, 203, 0.2),
    inset 0 1px 0 rgba(255, 192, 203, 0.3);
}

[data-theme="missing"] .sweet-message {
  background: linear-gradient(135deg, rgba(135, 206, 250, 0.15) 0%, rgba(173, 216, 230, 0.1) 100%);
  box-shadow: 
    0 8px 32px rgba(135, 206, 250, 0.1),
    inset 0 1px 0 rgba(135, 206, 250, 0.2);
}

[data-theme="missing"] .sweet-message:hover {
  box-shadow: 
    0 12px 40px rgba(135, 206, 250, 0.2),
    inset 0 1px 0 rgba(135, 206, 250, 0.3);
}

[data-theme="horny"] .sweet-message {
  background: linear-gradient(135deg, rgba(255, 69, 108, 0.15) 0%, rgba(255, 105, 135, 0.1) 100%);
  box-shadow: 
    0 8px 32px rgba(255, 69, 108, 0.1),
    inset 0 1px 0 rgba(255, 69, 108, 0.2);
}

[data-theme="horny"] .sweet-message:hover {
  box-shadow: 
    0 12px 40px rgba(255, 69, 108, 0.2),
    inset 0 1px 0 rgba(255, 69, 108, 0.3);
}

/* Responsive Design */
@media (max-width: 600px) {
  .analytics-section {
    max-width: 350px;
    margin: var(--spacing-lg) 0;
  }

  .sweet-message {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 20px;
  }

  .message-text {
    font-size: 0.95em;
    line-height: 1.4;
  }

  .visit-stats {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
  }
  
  /* Better mobile spacing for single user */
  .visit-stats .stat-item {
    width: 100%;
    max-width: 250px;
  }

  .stat-item {
    min-width: 160px;
    max-width: 200px;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .stat-user {
    font-size: 0.95em;
  }

  .today-visits {
    font-size: 0.8em;
  }

  .total-visits {
    font-size: 0.7em;
  }

  .insight-text {
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .analytics-section {
    max-width: 320px;
  }

  .sweet-message {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 18px;
  }

  .message-text {
    font-size: 0.9em;
    line-height: 1.3;
  }
}

/* Animation for analytics section appearance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analytics-section {
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* Pulse animation for active user stats */
.stat-item.active {
  animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.95;
  }
}

/* Special highlight for current session */
.stat-item.current-session {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
}

.stat-item.current-session .stat-user {
  color: white;
}

.stat-item.current-session .today-visits {
  color: white;
  font-weight: 600;
}

/* Placeholder state before login */
.stat-item.placeholder-stats {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.stat-item.placeholder-stats .stat-user {
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  text-shadow: none;
}

.stat-item.placeholder-stats .today-visits {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  text-shadow: none;
}

/* Other user stats highlighting */
.stat-item.other-user-stats {
  /* Inherits the beautiful gradient and effects from base .stat-item */
}

.stat-item.other-user-stats:hover {
  /* Enhanced hover effect for other user stats */
  transform: translateY(-6px) scale(1.03);
}
