:root {
  --primary-color: #00448B;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #CC1725;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --card-width: 550px;
}

@media (max-width: 767px) {
  :root {
    --card-width: 82vw;
  }

  .carousel-nav-btn {
    width: 34px !important;
    height: 34px !important;
    font-size: 1rem !important;
  }

  .carousel-nav-btn.prev-btn {
    right: 16px !important;
  }

  .carousel-nav-btn.next-btn {
    left: 16px !important;
  }
}

.text-bg-primary {
  background-color: var(--primary-color) !important;
  color: #fff !important;
}

body {
  background-color: var(--bg-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background-color 0.3s ease;
}

/* Override Bootstrap Primary Colors */
.bg-primary {
  background-color: var(--primary-color) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.btn-primary {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #003366 !important;
  border-color: #003366 !important;
}

.btn-outline-primary {
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
  background-color: var(--primary-color) !important;
  color: white !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

.badge.bg-primary {
  background-color: var(--primary-color) !important;
}

.bg-primary-soft {
  background-color: rgba(0, 68, 139, 0.1) !important;
}

/* Modern Hero Section Styling */
.bg-primary-soft {
  background-color: rgba(0, 68, 139, 0.1);
}

.play-btn-pulse {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  animation: pulse 2s infinite;
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-btn-pulse:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* Carousel Layout System */
.carousel-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  padding: 1.5rem 0 4rem 0;
}

.carousel-track {
  display: flex;
  gap: 24px;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  padding: 1rem 0 2rem 0;
  /* Add padding to center the active card perfectly */
  padding-right: calc(50% - var(--card-width) / 2);
  padding-left: calc(50% - var(--card-width) / 2);
}

.topic-card-wrapper {
  flex: 0 0 var(--card-width);
  width: var(--card-width);
  transition: all 0.4s ease;
}

.topic-card-bg {
  transition: background-color 0.5s ease, transform 0.5s ease, opacity 0.5s ease, box-shadow 0.5s ease, filter 0.5s ease;
}

.topic-card-bg.inactive-card {
  opacity: 0.4;
  transform: scale(0.92);
  filter: grayscale(10%) blur(0.5px);
  pointer-events: none;
  /* Disable mouse/keyboard on neighbors */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

.topic-card-bg.active-card {
  opacity: 1;
  transform: scale(1.02);
  filter: none;
  box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.5), inset 0 1px 4px rgba(255, 255, 255, 0.8), 0 20px 40px rgba(0, 0, 0, 0.18), 0 5px 15px rgba(0, 0, 0, 0.1) !important;
  border: 2.5px solid #ffffff !important;
}

/* Carousel Navigation Buttons */
.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff !important;
  border: 2.5px solid #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary-color) !important;
  z-index: 10;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.75), inset 0 1px 4px rgba(255, 255, 255, 0.8), 0 8px 24px rgba(0, 0, 0, 0.16) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.carousel-nav-btn:hover {
  background: #ffffff !important;
  color: #003366 !important;
  transform: translateY(-50%) scale(1.08) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.95), inset 0 1px 4px rgba(255, 255, 255, 0.8), 0 12px 28px rgba(0, 0, 0, 0.22) !important;
}

.carousel-nav-btn:disabled,
.carousel-nav-btn.disabled {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.carousel-nav-btn.prev-btn {
  right: 15px;
}

.carousel-nav-btn.next-btn {
  left: 15px;
}

/* Arrows are now shown on mobile too */

/* Full Card Slider Styles */
.topic-card-bg {
  transition: transform 0.5s ease, opacity 0.5s ease, box-shadow 0.5s ease, filter 0.5s ease;
  position: relative;
  overflow: hidden;
  touch-action: none;
  /* Disable mobile scroll on the card itself */
  user-select: none;
  /* Prevent text selection while dragging */
  cursor: pointer;
  min-height: 450px;
  background: linear-gradient(135deg, #fdfbf7 0%, #fbf7e7 50%, #f5ecd1 100%);
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.35), inset 0 1px 4px rgba(255, 255, 255, 0.8), 0 20px 40px rgba(0, 0, 0, 0.12);
}

.fill-level-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 0;
  /* Add slight border to clearly show the fill line if needed, but color might be enough */
  border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.rating-label-small {
  color: #6b7280;
  /* Gray */
  font-size: 0.75rem;
  padding: 3px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
  writing-mode: horizontal-tb;
  text-align: right;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.rating-label-small.active-label {
  color: #111827;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
  text-shadow: none;
  transform: scale(1.15);
  transform-origin: right center;
  font-weight: 800 !important;
}

.rating-label-small.covered-label {
  color: #ffffff !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.tick-mark {
  width: 8px;
  height: 2px;
  background-color: rgba(33, 37, 41, 0.25);
  border-radius: 1px;
}

.tick-mark.major {
  width: 14px;
  background-color: rgba(33, 37, 41, 0.5);
}

.inactivity-hint {
  position: absolute;
  top: 75%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fdfbf7 0%, #fbf7e7 50%, #f5ecd1 100%);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.45), inset 0 1px 4px rgba(255, 255, 255, 0.8), 0 6px 15px rgba(0, 0, 0, 0.12);
  animation: hintBounce 1.5s infinite ease-in-out;
  opacity: 0;
  transition: opacity 0.3s ease;
  border: 2.5px solid #ffffff;
}

.inactivity-hint.show {
  opacity: 1;
}

.inactivity-hint i {
  font-size: 1.1rem;
  color: var(--primary-color);
  line-height: 0.8;
}

@keyframes hintBounce {

  0%,
  100% {
    transform: translate(-50%, -50%);
  }

  50% {
    transform: translate(-50%, -60%);
  }
}

#slider-value-display {
  transition: top 0.1s ease;
  z-index: 10;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Topic Card Background Transition */
.topic-card-bg {
  transition: background-color 0.5s ease;
}

/* Tooltip for Disabled Button */
.disabled-wrapper {
  display: inline-block;
  cursor: not-allowed;
}

/* Page lock rules to prevent overflow */
.survey-page-body {
  min-height: 100vh !important;
  overflow-x: hidden !important;
}

/* Make bold tags in survey intro extra prominent */
#intro-body {
  font-weight: 400;
  color: #0f172a;
}

#intro-body strong,
#intro-body b {
  font-weight: 500;
  color: #0f172a;
  /* Slate 900 for high contrast against muted gray */
}

/* Percentage display in top-left of the card */
.percentage-display {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000000;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0.9;
}

/* Amorphous Floating Glow Backgrounds - Soft and Slow */
.bg-glow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background-color: #fafafa;
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.06;
  mix-blend-mode: multiply;
  will-change: transform;
}

.glow-red-1 {
  background-color: #d02433;
  width: 25vw;
  height: 25vw;
  top: -5vw;
  right: 15vw;
  animation: floatRed1 28s infinite alternate ease-in-out;
}

.glow-blue-1 {
  background-color: #014b92;
  width: 28vw;
  height: 28vw;
  bottom: -5vw;
  left: 10vw;
  animation: floatBlue1 33s infinite alternate ease-in-out;
}

.glow-red-2 {
  background-color: #d02433;
  width: 20vw;
  height: 20vw;
  bottom: 15vw;
  right: -5vw;
  animation: floatRed2 30s infinite alternate ease-in-out;
}

.glow-blue-2 {
  background-color: #014b92;
  width: 22vw;
  height: 22vw;
  top: 10vw;
  left: -5vw;
  animation: floatBlue2 25s infinite alternate ease-in-out;
}

@keyframes floatRed1 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-5vw, 6vw) scale(1.1);
  }
}

@keyframes floatBlue1 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(6vw, -5vw) scale(1.15);
  }
}

@keyframes floatRed2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-4vw, -6vw) scale(1.1);
  }
}

@keyframes floatBlue2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(5vw, 4vw) scale(1.1);
  }
}





/* Rating Fills Blending Mode over Gold */
.fill-level-indicator.main-fill {
  opacity: 1;
}

.fill-level-indicator.sidebar-fill {
  opacity: 1;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.25) 30%, rgba(255, 255, 255, 0) 70%, rgba(0, 0, 0, 0.15) 100%);
  background-blend-mode: overlay;
  border-top: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), inset 1px 0 0 rgba(255, 255, 255, 0.3), inset -1px 0 0 rgba(0, 0, 0, 0.2);
}

/* Glossy Liquid Highlight Reflection at the top of Sidebar Fill */
.fill-level-indicator.sidebar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0.22) 30%, rgba(255, 255, 255, 0.45) 45%, rgba(255, 255, 255, 0.22) 60%, rgba(255, 255, 255, 0) 80%);
  background-blend-mode: screen;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.7) 35%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.7) 35%, rgba(0, 0, 0, 0) 100%);
}



/* Sidebar Rating - Recessed 3D Groove Style */
.sidebar-rating {
  width: 100px;
  border-left: 2px solid rgba(0, 0, 0, 0.08);
  z-index: 2;
  overflow: hidden;
  box-shadow: inset -4px 0 10px rgba(0, 0, 0, 0.08), inset 4px 0 10px rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

/* Mobile Optimization - Prevent Scrolling & Adjust Brand Glows */
@media (max-width: 767px) {
  .survey-page-body {
    min-height: 100vh !important;
    overflow-y: auto !important;
  }

  .container.py-4 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .carousel-container {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding-top: 0.5rem !important;
    padding-bottom: 3.5rem !important;
    /* Large padding so shadow doesn't clip */
    margin-top: 0 !important;
    margin-bottom: -2.5rem !important;
    /* Compensate for the extra padding */
    overflow: hidden !important;
    /* Keep overflow hidden so neighbor cards do not show */
  }

  .carousel-track {
    padding-top: 0.5rem !important;
    padding-bottom: 1rem !important;
    /* Lighter track padding */
  }

  header {
    margin-bottom: 0.25rem !important;
    padding: 6px 0 !important;
  }

  footer {
    padding-top: 0 !important;
    padding-bottom: 0.25rem !important;
    margin-top: auto !important;
  }

  /* Weaken brand glow blobs on mobile so they do not clash with text */
  .glow-blob {
    filter: blur(80px) !important;
    opacity: 0.10 !important;
  }

  .glow-red-1 {
    width: 60vw !important;
    height: 60vw !important;
    top: -10vw !important;
    right: -10vw !important;
  }

  .glow-blue-1 {
    width: 65vw !important;
    height: 65vw !important;
    bottom: -10vw !important;
    left: -10vw !important;
  }

  .glow-red-2 {
    width: 45vw !important;
    height: 45vw !important;
    bottom: 20vw !important;
    right: -10vw !important;
  }

  .glow-blue-2 {
    width: 50vw !important;
    height: 50vw !important;
    top: 20vw !important;
    left: -10vw !important;
  }

  .modal-footer {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
  }

  .modal-footer .btn {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 0.85rem !important;
    flex: 1 1 auto !important;
    white-space: nowrap !important;
  }
}

/* Premium Action Buttons - Rich Blue Gradient with Gold Halo and White Border */
.btn-finish-survey,
#btn-desktop-submit,
#btn-submit-comment,
#btn-continue-survey,
#btn-understood-go,
#idleModal .btn-primary,
#opening-form button[type="submit"],
#btn-accept-cookies {
  background: linear-gradient(135deg, var(--primary-color) 0%, #002e60 100%) !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.5), 0 4px 12px rgba(0, 0, 0, 0.12) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn-finish-survey:hover,
#btn-desktop-submit:hover,
#btn-submit-comment:hover,
#btn-continue-survey:hover,
#btn-understood-go:hover,
#idleModal .btn-primary:hover,
#opening-form button[type="submit"]:hover,
#btn-accept-cookies:hover {
  background: linear-gradient(135deg, #0056b3 0%, var(--primary-color) 100%) !important;
  color: #ffffff !important;
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.8), 0 6px 18px rgba(0, 0, 0, 0.2) !important;
}

.btn-finish-survey:disabled,
.btn-finish-survey.disabled,
#btn-desktop-submit:disabled,
#btn-desktop-submit.disabled,
#btn-continue-survey:disabled,
#btn-continue-survey.disabled {
  background: #cbd5e1 !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
  box-shadow: none !important;
  transform: none !important;
  pointer-events: none !important;
  opacity: 0.65 !important;
}

/* Premium Secondary/Outline Buttons - Warm White/Cream with Gold Halo */
#btn-edit-survey,
#btn-restart-survey {
  background: rgba(255, 255, 255, 0.85) !important;
  color: var(--primary-color) !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.35), 0 4px 10px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  font-weight: bold !important;
}

#btn-edit-survey:hover,
#btn-restart-survey:hover {
  background: #ffffff !important;
  color: #003366 !important;
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.6), 0 6px 15px rgba(0, 0, 0, 0.15) !important;
}

#btn-restart-survey {
  color: #b91c1c !important;
  box-shadow: 0 0 0 1.5px rgba(220, 38, 38, 0.35), 0 4px 10px rgba(0, 0, 0, 0.08) !important;
}

#btn-restart-survey:hover {
  color: #991b1b !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.6), 0 6px 15px rgba(0, 0, 0, 0.15) !important;
}

/* Premium Toast Styles - Glassmorphic / White Gold Theme */
#survey-toast {
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(10px) !important;
  border: 2.5px solid #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.4), 0 10px 30px rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

#survey-toast .toast-body {
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  padding: 12px 16px !important;
}

#survey-toast .btn-close {
  filter: grayscale(1) brightness(0.2) !important;
  opacity: 0.7 !important;
}

#survey-toast .btn-close:hover {
  opacity: 1 !important;
}

/* Premium Modal, Completion Card & Opening Card Styles - Light Ivory-Gold Card Theme */
.modal-content,
#completion-container,
#opening-card {
  background: linear-gradient(135deg, #ffffff 0%, #fefdfa 50%, #faf6e8 100%) !important;
  border: 2.5px solid #ffffff !important;
  border-radius: 24px !important;
  box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.4), inset 0 1px 4px rgba(255, 255, 255, 0.8), 0 20px 50px rgba(0, 0, 0, 0.16) !important;
  color: #0f172a !important;
}

.modal-header,
.modal-footer {
  border: none !important;
  background: transparent !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

.modal-header {
  padding-top: 24px !important;
  padding-bottom: 8px !important;
}

.modal-footer {
  padding-bottom: 24px !important;
  padding-top: 8px !important;
}

.modal-body {
  padding: 16px 24px !important;
  font-size: 1.05rem !important;
  line-height: 1.6 !important;
  color: #334155 !important;
}

.modal-title {
  color: #0f172a !important;
  font-size: 1.5rem !important;
}

/* Thicken Chevron Icons inside Nav Buttons & Inactivity Hints */
.carousel-nav-btn i,
.inactivity-hint i {
  -webkit-text-stroke: 1.6px currentColor !important;
}