/* ============================================
   Winter Theme Styles for Urbex Planet
   Snowfall animations and frosty effects
   ============================================ */

:root {
  --winter-blue: #4a90e2;
  --winter-ice: #b8e6f5;
  --winter-frost: #e8f4f8;
  --winter-dark: #0d1b2a;
  --winter-mist: rgba(184, 230, 245, 0.15);
  --winter-shimmer: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Winter Banner/Toast Notification
   ============================================ */
.winter-banner {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--winter-blue), var(--winter-dark));
  border: 2px solid var(--winter-ice);
  border-radius: 12px;
  padding: 12px 20px;
  color: white;
  z-index: 10000;
  box-shadow: 0 8px 32px rgba(74, 144, 226, 0.3);
  animation: winter-banner-appear 0.8s ease-out;
  max-width: 320px;
  text-align: left;
  font-weight: 500;
  pointer-events: auto;
}

.winter-banner .winter-icon {
  font-size: 1.2rem;
  margin-right: 6px;
}

.winter-banner .close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}

.winter-banner .close-btn:hover {
  opacity: 1;
}

@keyframes winter-banner-appear {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   Frosted Window Corners
   ============================================ */
.winter-frost-corner {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3));
}

.winter-frost-corner.top-left {
  top: 0;
  left: 0;
  width: 150px;
  height: 150px;
}

.winter-frost-corner.top-right {
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  transform: scaleX(-1);
}

.winter-frost-corner svg {
  width: 100%;
  height: 100%;
}

/* Navbar Frost Decorations */
body.winter-theme nav.navbar::before,
body.winter-theme nav.navbar::after {
  content: '';
  position: absolute !important;
  top: 0;
  width: 120px;
  height: 120px;
  pointer-events: none;
  opacity: 0.5;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g stroke="%23ffffff" stroke-width="1.5" fill="none" opacity="0.6"><line x1="100" y1="20" x2="100" y2="180" stroke-width="2"/><line x1="20" y1="100" x2="180" y2="100" stroke-width="2"/><line x1="40" y1="40" x2="160" y2="160" stroke-width="1.5"/><line x1="160" y1="40" x2="40" y2="160" stroke-width="1.5"/><circle cx="100" cy="100" r="40" stroke-width="2"/><circle cx="100" cy="100" r="60" stroke-width="1.5"/><path d="M 100 20 L 110 40 L 130 40 L 115 52 L 120 70 L 100 60 L 80 70 L 85 52 L 70 40 L 90 40 Z" fill="%23ffffff" opacity="0.7"/><path d="M 100 180 L 110 160 L 130 160 L 115 148 L 120 130 L 100 140 L 80 130 L 85 148 L 70 160 L 90 160 Z" fill="%23ffffff" opacity="0.7"/><path d="M 20 100 L 40 110 L 40 130 L 52 115 L 70 120 L 60 100 L 70 80 L 52 85 L 40 70 L 40 90 Z" fill="%23ffffff" opacity="0.7"/><path d="M 180 100 L 160 110 L 160 130 L 148 115 L 130 120 L 140 100 L 130 80 L 148 85 L 160 70 L 160 90 Z" fill="%23ffffff" opacity="0.7"/></g></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 100 !important;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3));
  display: block !important;
}

body.winter-theme nav.navbar::before {
  left: 0;
}

body.winter-theme nav.navbar::after {
  right: 0;
  transform: scaleX(-1);
}

/* ============================================
   Snowflake Falling Animation
   ============================================ */
.winter-snowflake {
  position: fixed;
  color: white;
  font-size: 1em;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: winter-snowfall linear infinite;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes winter-snowfall {
  0% {
    opacity: 0;
    transform: translateY(-10px) translateX(0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) translateX(100px) rotate(360deg);
  }
}

/* Gentle swaying motion for snowflakes */
.winter-snowflake.sway-left {
  animation: winter-snowfall linear infinite, winter-sway-left 3s ease-in-out infinite;
}

.winter-snowflake.sway-right {
  animation: winter-snowfall linear infinite, winter-sway-right 3s ease-in-out infinite;
}

@keyframes winter-sway-left {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-30px);
  }
}

@keyframes winter-sway-right {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(30px);
  }
}

/* ============================================
   Ice Crystals (occasional decorative elements)
   ============================================ */
.winter-crystal {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  font-size: 2rem;
  opacity: 0;
  animation: winter-crystal-sparkle 8s ease-in-out infinite;
}

@keyframes winter-crystal-sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
  }
  50% {
    opacity: 0.6;
    transform: scale(1) rotate(180deg);
  }
}

/* ============================================
   Winter Theme Color Overrides
   ============================================ */
body.winter-theme {
  background: linear-gradient(180deg, #0d1b2a 0%, #1b3a52 50%, #0d1b2a 100%);
  background-attachment: fixed;
}

/* Navbar winter glow effect */
.winter-theme nav.navbar {
  position: sticky !important;
  overflow: visible !important;
  box-shadow: 0 4px 20px rgba(74, 144, 226, 0.2);
  border-bottom: 1px solid rgba(184, 230, 245, 0.1);
}

/* Ensure navbar has positioning context for frost decorations */
.winter-theme nav.navbar > .container {
  position: static;
}

/* Hero sections get frosty gradient */
.winter-theme .hero-gradient {
  background: linear-gradient(135deg, var(--winter-blue), var(--winter-dark), var(--winter-ice)) !important;
}

/* Cards get subtle winter border with frost effect */
.winter-theme .admin-card,
.winter-theme .card,
.winter-theme .location-card {
  border: 1px solid rgba(184, 230, 245, 0.2);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
  background: rgba(13, 27, 42, 0.4);
  backdrop-filter: blur(10px);
}

/* Button hover effects with icy glow */
.winter-theme .btn-primary:hover {
  box-shadow: 0 0 20px rgba(74, 144, 226, 0.5);
}

/* ============================================
   Shimmering Effect
   ============================================ */
@keyframes winter-shimmer {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

.winter-theme .navbar-brand {
  animation: winter-shimmer 4s ease-in-out infinite;
}

/* ============================================
   Frost Mist Background Effect
   ============================================ */
.winter-mist {
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: 
    radial-gradient(circle at 30% 40%, var(--winter-mist) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, var(--winter-mist) 0%, transparent 50%),
    radial-gradient(circle at 50% 20%, var(--winter-mist) 0%, transparent 50%);
  animation: winter-mist-drift 40s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes winter-mist-drift {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-50%);
  }
}

/* ============================================
   Particle Effects Container
   ============================================ */
.winter-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Small glittering ice particles */
.winter-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  opacity: 0.6;
  animation: winter-particle-twinkle 3s ease-in-out infinite;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

@keyframes winter-particle-twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

/* ============================================
   Frosty Text Shadow Effects
   ============================================ */
.winter-theme .hero h1,
.winter-theme .page-title {
  text-shadow: 
    0 0 10px var(--winter-ice),
    0 0 20px var(--winter-blue),
    0 0 30px rgba(255, 255, 255, 0.5);
}

/* ============================================
   Winter Badge Glow
   ============================================ */
.badge.winter-badge {
  background: linear-gradient(135deg, var(--winter-blue), var(--winter-ice));
  animation: winter-badge-pulse 3s ease-in-out infinite;
  box-shadow: 0 0 15px var(--winter-ice);
}

@keyframes winter-badge-pulse {
  0%, 100% {
    box-shadow: 0 0 15px var(--winter-ice);
  }
  50% {
    box-shadow: 0 0 25px var(--winter-ice), 0 0 35px var(--winter-blue);
  }
}

/* ============================================
   Frosted Glass Effect for Modals
   ============================================ */
.winter-theme .modal-content {
  background: rgba(13, 27, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(184, 230, 245, 0.2);
  box-shadow: 0 8px 32px rgba(74, 144, 226, 0.2);
}

/* ============================================
   Icicle Drips (subtle decoration)
   ============================================ */
.winter-icicle {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 20px solid rgba(184, 230, 245, 0.6);
  filter: drop-shadow(0 2px 4px rgba(74, 144, 226, 0.3));
  animation: winter-icicle-drip 5s ease-in-out infinite;
}

@keyframes winter-icicle-drip {
  0%, 100% {
    transform: scaleY(1);
    opacity: 0.6;
  }
  50% {
    transform: scaleY(1.2);
    opacity: 0.8;
  }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .winter-frost-corner {
    width: 80px;
    height: 80px;
    opacity: 0.3;
  }
  
  /* Navbar frost - smaller on mobile */
  body.winter-theme nav.navbar::before,
  body.winter-theme nav.navbar::after {
    width: 80px !important;
    height: 80px !important;
    opacity: 0.4 !important;
  }
  
  .winter-crystal {
    font-size: 1.5rem;
  }
  
  .winter-banner {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 0.85rem;
    padding: 10px 14px;
  }
  
  /* Reduce snowflake count visually on mobile */
  .winter-snowflake:nth-child(n+21) {
    display: none;
  }
  
  /* Simplify mist on mobile */
  .winter-mist {
    opacity: 0.2;
  }

  /* Hide icicles on mobile */
  .winter-icicle {
    display: none;
  }
}

/* Medium screens (tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
  body.winter-theme nav.navbar::before,
  body.winter-theme nav.navbar::after {
    width: 100px !important;
    height: 100px !important;
    opacity: 0.45 !important;
  }
}

/* ============================================
   Accessibility: Reduce Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .winter-snowflake,
  .winter-crystal,
  .winter-mist,
  .winter-particle,
  .winter-banner,
  .winter-icicle,
  .winter-theme .navbar-brand,
  .winter-theme h1,
  .winter-theme h2 {
    animation: none;
  }
  
  .winter-frost-corner {
    opacity: 0.3;
  }
}

/* ============================================
   Footer polish in Winter Mode
   ============================================ */
.winter-theme footer {
  background: transparent;
  border-top: 1px solid rgba(184, 230, 245, 0.1) !important;
  box-shadow: none;
}

/* Footer internal dividers should stay subtle */
.winter-theme footer hr {
  border-color: rgba(184, 230, 245, 0.08) !important;
}

/* Prevent nav glow/borders inside footer */
.winter-theme footer nav {
  box-shadow: none !important;
}

/* ============================================
   Print Styles (Hide Winter Effects)
   ============================================ */
@media print {
  .winter-snowflake,
  .winter-crystal,
  .winter-frost-corner,
  .winter-mist,
  .winter-particles,
  .winter-banner,
  .winter-icicle {
    display: none !important;
  }
}
