/* --- Root & Reset --- */
:root {
  --primary: #6366f1;
  --primary-dark: #4338ca;
  --secondary: #ec4899;
  --bg-soft: #f8fafc;
  /* Fluid Spacing Scale */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --container-pad: clamp(1rem, 5vw, 2.5rem);
}

/* --- Layout & Main Containers --- */
.pq-wrapper {
  color: #1f2937;
  max-width: 1300px;
  line-height: 1.6;
  margin: clamp(1rem, 4vw, 2rem) auto;
  padding: 0 var(--space-s);
}

.pq-main-card {
  background: #fff;
  border-radius: clamp(16px, 4vw, 24px);
  padding: var(--container-pad);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  animation: slideUpFade 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Hero & Typography --- */
.pq-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  color: white;
  padding: clamp(1.5rem, 5vw, 3rem);
  border-radius: clamp(16px, 4vw, 24px);
  text-align: center;
  margin-bottom: clamp(1.5rem, 5vw, 3rem);
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}
div#pq-hero-area {
    margin: -1.5rem -1rem;
}
/* Fluid font sizing: min 1.4rem, scales with width, max 2.2rem */
.pq-hero h2 {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 900;
  margin: 0.5rem 0;
  color: #fff;
  line-height: 1.2;
}

.pq-question-title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
 
  margin-bottom: var(--space-m);
  color: #111827;
}

.pq-section-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 800;
  margin-bottom: var(--space-s);
  color: var(--primary-dark);
  border-left: 5px solid var(--secondary);
  padding-left: 12px;
}

/* --- Progress Bar --- */
.pq-progress-bg {
  height: clamp(10px, 2vw, 14px);
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: var(--space-m);
  position: relative;
}

.pq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% 100%;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: shimmer 3s infinite linear, progressEntrance 1s ease-out forwards;
  position: relative;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.pq-progress-fill::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 10px; height: 100%;
  background: white;
  filter: blur(5px);
  opacity: 0.5;
}

/* --- Options & Buttons --- */
.pq-options-list {
  display: grid;
  gap: 12px;
}

.pq-opt-btn {
  padding: clamp(14px, 3vw, 18px) clamp(16px, 4vw, 24px);
  border: 2px solid #f3f4f6;
  background: #fff;
  border-radius: 15px;
  cursor: pointer;
  font-size: clamp(0.95rem, 2vw, 1rem);
  font-weight: 600;
  transition: all 0.25s ease;
  text-align: left;
}

.pq-opt-btn:hover {
  border-color: var(--primary);
  background: #f5f3ff;
  transform: translateX(5px);
}

/* --- Results Grid --- */
.pq-grid {
  display: grid;
  gap: var(--space-s);
  /* Responsive grid that adjusts column count based on available space */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin-bottom: var(--space-l);
}

.pq-card-item {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 20px;
  padding: var(--space-m);
  box-shadow: 0 4px 6px rgba(0,0,0,0.03);
  position: relative;
  opacity: 0;
  animation: slideUpFade 0.5s ease forwards;
}

.pq-card-item.dominant {
  border: 2px solid var(--primary);
  background: #fdf4ff;
  animation: slideUpFade 0.5s ease forwards, pulseGlow 2.5s infinite;
}

.pq-dom-tag {
  position: absolute;
  bottom: 0; right: 0;
  background: var(--secondary);
  color: white;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 15px 0 18px 0;
}

/* --- Famous Quote Styling --- */
.famous-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.famous-icon {
  width: 38px; height: 38px;
  background: #e0e7ff;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: bold;
}

.famous-quote {
  font-style: italic;
  color: #4b5563;
  font-size: 0.85rem;
  background: #f9fafb;
  padding: 12px;
  border-radius: 12px;
}

/* --- Footer & Actions --- */
.pq-chart-wrap {
  height: clamp(250px, 50vh, 400px);
  margin-bottom: var(--space-l);
}

.pq-delete-btn {
  width: 100%;
  padding: 16px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 15px;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.95rem;
}
button.pq-delete-btn {
    font-size: 12px;
    color: #fff;
    background: #121111;
}
/* --- MEDIA QUERIES FOR MOBILE --- */
@media (max-width: 640px) {
  .pq-main-card {
    padding: 1.5rem 1rem; /* Less padding on small screens */
  }

  .pq-hero {
    padding: 1.5rem 1rem;
    border-radius: 16px;
  }

  .pq-opt-btn:hover {
    transform: none; /* Disable hover movement on touch screens */
  }

  .pq-card-item {
    padding: 1.2rem;
  }
}

/* --- KEYFRAMES --- */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes progressEntrance {
  0% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
