/* Trenovaxia - Winter Tire Storage Solutions */
/* Custom styles extending Tailwind */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* Body lock for mobile menu */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
  background: #919faf;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #728394;
}

/* Header transition on scroll */
.header-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98) !important;
}

/* Image placeholder styling */
img[src=""] {
  background: linear-gradient(135deg, #dbe6fe 0%, #bfcffc 50%, #d9dee4 100%);
  min-height: 200px;
  display: block;
}

/* Mobile menu animations */
#mobile-menu .absolute.right-0 {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.open .absolute.right-0 {
  transform: translateX(0);
}

#mobile-menu #menu-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobile-menu.open #menu-backdrop {
  opacity: 1;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #3b5eeb;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Card hover effects */
.storage-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.storage-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(30, 40, 166, 0.1);
}

/* Gradient text utility */
.text-gradient {
  background: linear-gradient(135deg, #3b5eeb, #6085f2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated gradient background */
.bg-animated-gradient {
  background: linear-gradient(-45deg, #1e2aa6, #3b5eeb, #2541df, #161b50);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Snowfall animation for hero */
@keyframes snowfall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.snowflake {
  position: absolute;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

/* Comparison slider styles */
.comparison-container {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.comparison-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: white;
  cursor: ew-resize;
  z-index: 10;
}

.comparison-slider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Space planner grid */
.planner-grid {
  display: grid;
  gap: 2px;
  background: #d9dee4;
  border-radius: 8px;
  overflow: hidden;
}

.planner-cell {
  background: #f8f9fa;
  aspect-ratio: 1;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.planner-cell:hover {
  background: #dbe6fe;
}

.planner-cell.active {
  background: #3b5eeb;
}

.planner-cell.tire {
  background: #1e2aa6;
  border-radius: 50%;
}

/* Cookie consent animation */
#cookie-consent {
  animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%) translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

/* Form styles */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #d9dee4;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: white;
}

.form-input:focus {
  border-color: #3b5eeb;
  box-shadow: 0 0 0 3px rgba(59, 94, 235, 0.15);
  outline: none;
}

.form-input:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.form-input:valid:not(:placeholder-shown) {
  border-color: #22c55e;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #393f49;
  font-size: 0.875rem;
}

/* Checklist interactive styles */
.checklist-item {
  transition: background-color 0.2s ease;
}

.checklist-item.completed {
  background-color: rgba(34, 197, 94, 0.1);
}

.checklist-item.completed .checklist-icon {
  color: #22c55e;
}

/* Print styles for labels */
@media print {
  header, footer, #cookie-consent, #mobile-menu {
    display: none !important;
  }
  
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* Responsive image galleries */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-grid .col-span-2 {
    grid-column: span 1;
  }
  
  .gallery-grid .row-span-2 {
    grid-row: span 1;
  }
}

/* Pulse animation for CTA */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 94, 235, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(59, 94, 235, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 94, 235, 0);
  }
}

.pulse-cta {
  animation: pulse-ring 2s infinite;
}

/* Temperature gauge visual */
.temp-gauge {
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #3b82f6, #22c55e, #eab308, #ef4444);
  position: relative;
}

.temp-indicator {
  position: absolute;
  top: -4px;
  width: 20px;
  height: 20px;
  background: white;
  border: 3px solid #1e2aa6;
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.3s ease;
}

/* Selection states for interactive planner */
.method-option {
  border: 2px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.method-option.selected {
  border-color: #3b5eeb;
  background-color: #f0f5ff;
}

.method-option:hover {
  border-color: #93aef8;
}

/* Loading state */
.skeleton {
  background: linear-gradient(90deg, #eef0f3 25%, #d9dee4 50%, #eef0f3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #252930;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tooltip:hover::after {
  opacity: 1;
}