/* Optimized Affiliate Redirect Kit - Styles */

/* ===== Variables ===== */
:root {
  /* Color Palette - Dark Theme */
  --color-primary: #ff3e3e;
  --color-primary-dark: #8b0000;
  --color-primary-darker: #4d0000;
  --color-background: #000000;
  --color-surface: #111111;
  --color-text: #ffffff;
  --color-text-light: #a0a0a0;
  --color-border: #2a2a2a;
  --color-link-hover: #ff5252;
  
  /* Sizing and Spacing */
  --container-max-width: 500px;
  --container-padding: 40px;
  --border-radius-large: 12px;
  --border-radius-medium: 6px;
  --border-radius-small: 3px;
  
  /* Animations */
  --transition-speed: 0.3s;
}

/* ===== Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--color-background) 0%, var(--color-surface) 100%);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--color-text);
  padding: 20px;
}

/* Background glow effect */
body::before {
  content: '';
  position: fixed;
  bottom: -10vh;
  left: 0;
  width: 100%;
  height: 60vh;
  /* Fallback gradient */
  background: linear-gradient(180deg, transparent 0%, #4d0000 35%, #8b0000 55%, #ff3e3e 75%, transparent 100%);
  /* Modern gradient with variables */
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--color-primary-darker) 35%,
    var(--color-primary-dark) 55%,
    var(--color-primary) 75%,
    transparent 100%
  );
  animation: lavaMove 12s ease-in-out infinite;
  opacity: 0.4;
  filter: blur(60px);
  transform-origin: center bottom;
  pointer-events: none;
  z-index: -1;
}

/* ===== Container Styles ===== */
.redirect-container {
  background-color: var(--color-surface);
  border-radius: var(--border-radius-large);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: var(--container-padding);
  max-width: var(--container-max-width);
  width: 90%;
}

.redirect-logo {
  margin-bottom: 20px;
  max-width: 150px;
}

/* ===== Typography ===== */
h1 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--color-text);
}

p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 25px;
  color: var(--color-text-light);
  min-height: 25px;
}

.destination-info {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 15px;
  font-style: italic;
}

.redirect-footer {
  margin-top: 30px;
  font-size: 12px;
  color: var(--color-text-light);
}

/* ===== Animation Components ===== */
/* Animation container to maintain consistent space */
.animation-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
}

/* Loading animation */
.loading-animation {
  position: absolute;
  width: 120px;
  height: 120px;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  opacity: 1;
  transition: opacity var(--transition-speed) ease;
}

.loading-animation.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Tick animation */
.tick-animation {
  position: absolute;
  width: 120px;
  height: 120px;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

.tick-animation.visible {
  opacity: 1;
  visibility: visible;
}

/* Fallback loader (rarely used) */
.loader {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid var(--color-border);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}

.loader.hidden {
  display: none;
}

/* Fallback tick icon (rarely used) */
.tick-icon {
  display: none;
  width: 50px;
  height: 50px;
  margin-bottom: 20px;
  color: var(--color-primary);
  font-size: 40px;
}

.tick-icon.visible {
  display: inline-block;
}

/* ===== Progress Bar ===== */
.redirect-progress {
  width: 100%;
  height: 6px;
  background-color: var(--color-border);
  border-radius: var(--border-radius-small);
  overflow: hidden;
  margin-top: 20px;
  position: relative;
}

.redirect-progress-bar {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: var(--border-radius-small);
  width: 0%;
  transition: width 0.1s ease-out;
}

.redirect-progress-bar.loading {
  animation: progress 4s ease-in-out forwards;
}

.redirect-progress-bar.animated {
  animation: progress 3s ease-in-out forwards;
}

/* ===== Button Styles ===== */
.redirect-button {
  background-color: var(--color-primary);
  color: var(--color-text);
  border: none;
  border-radius: var(--border-radius-medium);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  margin-top: 10px;
  margin-bottom: 10px;
  opacity: 0;
  height: 45px;
  min-width: 160px;
  display: inline-block;
  pointer-events: none;
}

.redirect-button.visible {
  opacity: 1;
  pointer-events: auto;
}

.redirect-button:hover {
  background-color: var(--color-primary-dark);
}

.redirect-button:focus {
  outline: 2px solid var(--color-primary-darker);
}

.redirect-button:active {
  transform: translateY(1px);
}

/* ===== Animations ===== */
@keyframes lavaMove {
  0%, 100% {
    transform: scaleY(1);
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1.05);
    opacity: 0.5;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes progress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ===== Media Queries ===== */
@media (max-width: 480px) {
  .redirect-container {
    padding: 30px 20px;
  }
  
  h1 {
    font-size: 20px;
  }
  
  p {
    font-size: 14px;
  }
  
  .animation-container {
    width: 100px;
    height: 100px;
  }
  
  .loading-animation,
  .tick-animation {
    width: 100px;
    height: 100px;
  }
}

/* ===== Print Styles ===== */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .redirect-container {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .redirect-button {
    display: none;
  }
} 