﻿@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap");

:root {
  /* Color Palette - Green Nature Theme */
  --primary-gradient: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  --secondary-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --success-gradient: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
  --dark-bg: #1a2f1a;
  --dark-secondary: #243324;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(168, 224, 99, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #c8f0c8;
  --shadow-glow: 0 8px 32px 0 rgba(86, 171, 47, 0.4);
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.5);

  /* Spinner Colors - Green Variations */
  --color-1: #4caf50;
  --color-2: #8bc34a;
  --color-3: #66bb6a;
  --color-4: #9ccc65;
  --color-5: #81c784;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Outfit", sans-serif;
  background: linear-gradient(rgba(26, 47, 26, 0.75), rgba(36, 51, 36, 0.85)),
    url("/bg.jpeg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  margin: 0;
  padding: 0 0 1.5rem 0;
}

/* Animated Background */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(102, 126, 234, 0.2) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(118, 75, 162, 0.2) 0%,
      transparent 50%
    );
  animation: backgroundPulse 10s ease-in-out infinite;
  pointer-events: none;
}

@keyframes backgroundPulse {
  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  min-height: 100vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-container {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.company-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
  text-shadow: 0 0 30px rgba(86, 171, 47, 0.5);
}

.header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 300;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  animation: fadeInUp 0.8s ease-out 0.2s both;
  width: 100%;
  max-width: 1200px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Input Section */
.input-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  box-shadow: var(--shadow-glow);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 450px;
}

/* Product Section */
.product-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.product-image-container {
  width: 100%;
  max-width: 200px;
  height: 280px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem auto;
  transition: opacity 0.3s ease;
}

.product-image-container.move-left {
  transform: translateX(-100px);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(102, 126, 234, 0.4));
  transition: all 0.3s ease;
}

.product-image:hover {
  filter: drop-shadow(0 12px 30px rgba(102, 126, 234, 0.6));
  transform: scale(1.05);
}

.input-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  box-shadow: var(--shadow-glow);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 450px;
}

.input-section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
}

.input-group {
  margin-bottom: 1.2rem;
}

.input-group label {
  display: block;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: "Outfit", sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.input-group input:focus {
  border-color: #56ab2f;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(86, 171, 47, 0.4);
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.spin-button {
  width: 100%;
  padding: 1rem;
  background: var(--primary-gradient);
  border: none;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.spin-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.spin-button:hover::before {
  width: 300px;
  height: 300px;
}

.spin-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

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

.spin-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.spin-button span {
  position: relative;
  z-index: 1;
}

.result-display {
  margin-top: 1.2rem;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  display: none;
  transform: scale(0.9);
  transition: all 0.3s ease;
}

.result-display.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.result-display .discount-text {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--secondary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
  animation: pulse 1s ease-in-out;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.result-display .result-label {
  color: var(--text-secondary);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Spinner Section */
.spinner-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.spinner-container {
  position: relative;
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#spinnerWheel {
  width: 100%;
  height: 100%;
}

.spinner-arrow {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  z-index: 10;
}

@keyframes arrowBounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.spinner-label:nth-child(3) {
  transform: rotate(180deg);
}

.spinner-label:nth-child(3) span {
  transform: rotate(-180deg);
  display: inline-block;
}

.spinner-label:nth-child(4) {
  transform: rotate(252deg);
}

.spinner-label:nth-child(4) span {
  transform: rotate(-252deg);
  display: inline-block;
}

/* Status Message */
.status-message {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.status-message.show {
  display: block;
  opacity: 1;
}

.status-message.success {
  background: rgba(129, 199, 132, 0.25);
  color: #81c784;
  border: 1px solid rgba(129, 199, 132, 0.4);
}

.status-message.error {
  background: rgba(255, 138, 101, 0.2);
  color: #ff8a65;
  border: 1px solid rgba(255, 138, 101, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .product-image-container {
    max-width: 240px;
    height: 350px;
  }

  .spinner-container {
    width: 280px;
    height: 280px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
    max-width: 600px;
  }

  .main-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .header p {
    font-size: 0.9rem;
  }

  .spinner-container {
    width: 280px;
    height: 280px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.8rem;
  }

  .header {
    margin-bottom: 1rem;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .header p {
    font-size: 0.85rem;
  }

  .input-section {
    padding: 1.2rem;
  }

  .input-group label {
    font-size: 0.8rem;
  }

  .input-group input {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }

  .spin-button {
    padding: 0.9rem;
    font-size: 1rem;
  }

  .result-display .discount-text {
    font-size: 2rem;
  }

  .result-display .result-label {
    font-size: 0.85rem;
  }

  .spinner-container {
    width: 260px;
    height: 260px;
  }

  .status-message {
    font-size: 0.8rem;
    padding: 0.7rem;
  }
}

@media (max-width: 360px) {
  .header h1 {
    font-size: 1.6rem;
  }

  .spinner-container {
    width: 240px;
    height: 240px;
  }

  .input-section {
    padding: 1rem;
  }

  .result-display .discount-text {
    font-size: 1.8rem;
  }
}

/* Confetti Animation */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #f093fb;
  position: absolute;
  animation: confetti-fall 3s linear forwards;
  z-index: 1000;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.product-image-container.hide {
  opacity: 0;
  display: none;
}
