:root {
  --bg-color: #0a0a0f;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary-accent: #7c3aed; /* Violet */
  --secondary-accent: #2563eb; /* Blue */
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --success-color: #10b981;
  --error-color: #ef4444;
  --font-family: "Outfit", sans-serif;
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Prevent scroll for the background glow */
  position: relative;
}

/* Background Glow Effect */
.background-glow {
  position: absolute;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(
    circle,
    rgba(124, 58, 237, 0.15) 0%,
    rgba(10, 10, 15, 0) 70%
  );
  top: -20%;
  left: 20%;
  border-radius: 50%;
  z-index: -1;
  animation: pulseGlow 10s infinite alternate;
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Bento Grid Layout */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto;
  gap: 1.5rem;
  width: 90%;
  max-width: 1000px;
  padding: 2rem;
}

/* Card Styles */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1),
    border-color var(--transition-speed) ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Specific Card Placements */
.header-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-card h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.header-card p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.input-card {
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.input-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--primary-accent);
}

.input-wrapper label {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 1rem;
  width: 20px;
}

.input-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.2rem;
  font-family: var(--font-family);
  width: 100%;
  outline: none;
}

/* Hide default number input spinners */
.input-wrapper input::-webkit-outer-spin-button,
.input-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-wrapper input[type=number] {
  -moz-appearance: textfield;
}

/* Custom Input Controls */
.input-controls {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  margin-left: auto;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(75, 75, 85, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.control-btn:hover {
  background: rgba(100, 100, 110, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn svg {
  width: 18px;
  height: 18px;
  color: var(--text-main);
}

/* Main Button Styling */
#check-btn {
  background: linear-gradient(
    135deg,
    var(--primary-accent),
    var(--secondary-accent)
  );
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  font-family: var(--font-family);
}

#check-btn:hover {
  opacity: 0.9;
}

#check-btn:active {
  transform: scale(0.98);
}

.result-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.status-icon svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  transition: color 0.3s;
}

.result-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.result-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Dynamic Status Classes */
.result-card.valid {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.05);
}

.result-card.valid .status-icon svg {
  color: var(--success-color);
}

.result-card.invalid {
  border-color: var(--error-color);
  background: rgba(239, 68, 68, 0.05);
}

.result-card.invalid .status-icon svg {
  color: var(--error-color);
}

.guide-card {
  grid-column: span 2;
}

.guide-card h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guide-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.guide-list .icon {
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.guide-list .text {
  display: flex;
  flex-direction: column;
}

.guide-list .text strong {
  font-size: 1rem;
}

.guide-list .text span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.decoration-card {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.visualizer {
  position: relative;
  width: 100px;
  height: 100px;
}

.visualizer .circle {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.c1 {
  width: 100%;
  height: 100%;
  animation: spin 10s linear infinite;
  border-top-color: var(--primary-accent);
}
.c2 {
  width: 70%;
  height: 70%;
  animation: spin 7s linear infinite reverse;
  border-bottom-color: var(--secondary-accent);
}
.c3 {
  width: 40%;
  height: 40%;
  background: rgba(255, 255, 255, 0.05);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    width: 100%;
  }

  .header-card,
  .input-card,
  .result-card,
  .guide-card,
  .decoration-card {
    grid-column: span 1;
  }

  .input-card {
    grid-row: auto;
  }
}
