@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Campus Colors */
  --primary-color: #1a237e;
  --primary-light: #534bae;
  --primary-dark: #000051;
  --secondary-color: #00bcd4;
  --secondary-light: #62efff;
  --secondary-dark: #008ba3;
  --accent-color: #ff4081;

  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #f44336;

  --bg-body: #f0f2f5;
  --bg-card: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --white: #ffffff;

  --shadow-sm: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
  
  --radius-md: 12px;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: transparent;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: var(--bg-body) url('../images/wallpaper.jpg') no-repeat center center / cover;
  filter: blur(8px);
  transform: scale(1.05); /* Prevent blur edge artifacts */
}

/* Card Style */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  margin: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.glass-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  margin: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Typography */
h1, h2, h3 {
  margin-top: 0;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
  color: var(--primary-color);
}

p {
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Form Elements */
.survey-question {
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s forwards ease-out;
}

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

.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.option-label {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.option-label:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(5px);
}

input[type="radio"] {
  display: none;
}

input[type="radio"]:checked + .option-label {
  background: var(--primary-color);
  color: var(--white);
  font-weight: 600;
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 1rem;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
  position: relative;
  text-align: center;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 1rem;
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
  position: relative;
  text-align: center;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
}

/* Wizard Header & Progress Bar */
.survey-header {
  margin-bottom: 2rem;
  text-align: center;
}

.school-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

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

.survey-description {
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.progress-container {
  width: 100%;
  background: rgba(0, 0, 0, 0.05);
  height: 10px;
  border-radius: 5px;
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
  background-size: 200% auto;
  box-shadow: 0 0 8px rgba(0, 188, 212, 0.5);
  animation: glowStripe 2s linear infinite;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.streak-badge {
  animation: pulseFire 1.5s infinite alternate;
}

@keyframes pulseFire {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px rgba(255, 87, 34, 0.2));
  }
  100% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 8px rgba(255, 87, 34, 0.6));
  }
}

.step-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

/* Page Transition Animations */
.survey-page {
  display: none;
  opacity: 0;
}

.survey-page.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slideInPage 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideInPage {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.floating-xp-bubble {
  position: fixed;
  color: #00bcd4;
  font-weight: 800;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 10000;
  animation: floatUpXP 0.8s ease-out forwards;
  text-shadow: 0 2px 10px rgba(0, 188, 212, 0.5), 0 0 2px rgba(255, 255, 255, 0.8);
}

@keyframes floatUpXP {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -20px) scale(1.3);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60px) scale(1);
  }
}

/* Dynamic Inputs & Textareas */
input[type="text"], textarea {
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #ced4da;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Checkbox Styles (reusing option-label) */
input[type="checkbox"] {
  display: none;
}

input[type="checkbox"] + .option-label::before {
  content: '☐';
  margin-right: 0.75rem;
  font-size: 1.2rem;
  line-height: 1;
}

input[type="checkbox"]:checked + .option-label {
  background: var(--primary-color);
  color: var(--white);
  font-weight: 600;
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

input[type="checkbox"]:checked + .option-label::before {
  content: '☑';
}

/* Custom Multi-Select with write-in option */
.custom-write-in-container {
  margin-top: 0.5rem;
  animation: fadeIn 0.3s ease;
}

/* Grid Matrix Layout */
.grid-matrix-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.grid-matrix-header {
  display: grid;
  grid-template-columns: 3.5fr repeat(var(--cols), 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.8rem 0.5rem;
  background: #f8f9fa;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e9ecef;
}

.grid-matrix-header-label {
  text-align: left;
  padding-left: 0.5rem;
}

.grid-matrix-row {
  display: grid;
  grid-template-columns: 3.5fr repeat(var(--cols), 1fr);
  align-items: center;
  padding: 0.8rem 0.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e9ecef;
  border-left: 4px solid transparent;
  transition: background 0.3s ease, border-left 0.3s ease;
}

.grid-matrix-row:hover {
  background: #f8f9fa;
}

.grid-matrix-row.row-answered {
  background: rgba(0, 188, 212, 0.08);
  border-left: 4px solid var(--secondary-color);
}

.grid-matrix-cells-container {
  display: contents;
}

.grid-matrix-row-label {
  font-size: 0.9rem;
  padding-left: 0.5rem;
  color: var(--text-primary);
}

.grid-matrix-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

.grid-matrix-cell input[type="radio"] {
  display: inline-block;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

/* Mobile responsive adjustments for Grid Matrix */
@media (max-width: 580px) {
  .grid-matrix-header {
    display: none;
  }
  
  .grid-matrix-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1.2rem;
    border-bottom: 1px solid #e9ecef;
  }
  
  .grid-matrix-row-label {
    font-weight: 600;
    padding-left: 0;
  }
  
  .grid-matrix-cells-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
  }
  
  .grid-matrix-cell {
    flex: 1;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 0.5rem 0.2rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
  }
  
  .grid-matrix-cell::after {
    content: attr(data-label);
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: center;
  }
}

/* Loading state */
#loading-screen, #error-screen {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* SweetAlert2 Overrides to match theme */
div.swal2-popup {
  background: #ffffff !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-md) !important;
}

.swal2-confirm {
  background-color: var(--primary-color) !important;
  border-radius: var(--radius-md) !important;
}


/* Glossy Capsule for Logo */
.glossy-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 24px rgba(31, 38, 135, 0.15), inset 0 4px 8px rgba(255, 255, 255, 0.6);
  padding: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.glossy-capsule img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Glassmorphism Icon Container */
.glass-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.3));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05), inset 0 2px 5px rgba(255,255,255,0.6);
  font-size: 1.4rem;
  transition: transform 0.3s ease;
}
.glass-icon:hover {
  transform: translateY(-2px);
}

/* Mobile Screen Adaptations (max-width: 480px) */
@media (max-width: 480px) {
  body {
    padding: 0.5rem !important;
  }
  .glass-card {
    padding: 1.25rem !important;
    margin: 0.5rem auto !important;
    border-radius: 16px !important;
  }
  .survey-header h1 {
    font-size: 1.5rem !important;
  }
  .gamification-panel {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center;
    gap: 0.6rem;
    padding: 0.8rem !important;
  }
  .gamification-panel > div {
    justify-content: center !important;
  }
  #btn-mute {
    justify-content: center !important;
    width: 100%;
  }
  .wizard-nav {
    flex-direction: column !important;
    gap: 0.6rem;
  }
  .wizard-nav button {
    width: 100% !important;
    padding: 0.8rem !important;
  }
}

/* Cookie Consent Overlay & Modal */
.cookie-overlay-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 30, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

.cookie-overlay-container.show {
  opacity: 1;
}

.cookie-consent-modal {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-md);
  max-width: 480px;
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: 20px;
  transform: scale(0.9) translateY(10px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cookie-overlay-container.show .cookie-consent-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.cookie-icon-wrapper {
  margin-bottom: 1.5rem;
}

.cookie-glow {
  font-size: 2rem;
  color: var(--warning-color);
  background: rgba(255, 152, 0, 0.15) !important;
  border-color: rgba(255, 152, 0, 0.3) !important;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: pulseWarning 2s infinite alternate;
}

@keyframes pulseWarning {
  0% {
    box-shadow: 0 0 4px rgba(255, 152, 0, 0.2);
  }
  100% {
    box-shadow: 0 0 16px rgba(255, 152, 0, 0.6);
  }
}

.cookie-subtext {
  font-size: 0.85rem;
  margin-top: 1rem;
  opacity: 0.8;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Mobile responsive adjustments for Cookie Modal */
@media (max-width: 480px) {
  .cookie-consent-modal {
    padding: 1.75rem 1.25rem !important;
    margin: 1.5rem;
  }
  .cookie-buttons {
    flex-direction: column;
    gap: 0.6rem;
  }
}

