@font-face {
  font-family: "Proxima Nova";
  src: url("/proxima_nova_font/Proxima Nova Regular/Proxima Nova Regular.ttf")
    format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Proxima Nova";
  src: url("/proxima_nova_font/Proxima Nova Light/Proxima Nova Light.ttf")
    format("truetype");
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: "Proxima Nova";
  src: url("/proxima_nova_font/Proxima Nova Semibold/Proxima Nova Semibold.ttf")
    format("truetype");
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: "Proxima Nova";
  src: url("/proxima_nova_font/Proxima Nova Extrabold/Proxima Nova Extrabold.ttf")
    format("truetype");
  font-weight: 800;
  font-style: normal;
}

body {
  padding: 20px;
  font-family: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
}

table {
  font-family: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

tr.htmx-swapping td {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

td,
th {
  border: 1px solid #383737;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}

/* ============================================
   Responsive Breakpoints (Mobile First)
   ============================================ */

/* Extra Small devices (phones, less than 576px) */
/* Base styles - mobile first, no media query needed */

.outer-container {
}

.inner-container {
  width: 100%;
  max-width: 600px;
  min-height: 50vh;
  margin: auto;
  padding: 24px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.main-title {
  text-align: center;
  font-weight: 700;
  margin-bottom: 1rem;
}

.description {
  text-align: center;
  font-weight: 400;
  margin-bottom: 3rem;
}

.custom-form-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.primary-label {
  font-size: 1.25rem;
  font-weight: 600;
}

.primary-input {
  width: 100%;
  padding: 8px;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1.25rem;
  box-sizing: border-box;
}

.primary-button {
  width: 100%;
  padding: 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.25rem;
  cursor: pointer;
  box-sizing: border-box;
}

.primary-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.65;
}

.factors-icons-container {
}

.factors-icons-inner-container {
  /* use grid structure to put three icons in each line, center them */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 140px));
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* Mobile screens - 2 columns */
@media (max-width: 576px) {
  .factors-icons-inner-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet and desktop - 3 columns */
@media (min-width: 577px) {
  .factors-icons-inner-container {
    grid-template-columns: repeat(3, 1fr);
    max-width: 500px;
    margin: 0 auto;
  }
}

.factor-icon {
  width: 140px;
  height: 140px;
  cursor: pointer;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: scaleIn 0.4s ease-out;
}

.factor-icon:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.factor-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  body {
    padding: 24px;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  body {
    padding: 32px;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  body {
    padding: 40px;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  body {
    padding: 48px;
  }
}

/* Extra extra large devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
  body {
    padding: 56px;
  }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

.slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

.scale-in {
  animation: scaleIn 0.4s ease-out;
}

.bounce-in {
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   Message States (Success & Error)
   ============================================ */

.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  margin-top: 24px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  animation: slideInUp 0.5s ease-out;
}

.error-message-challenge-res {
  /* Additional specific styling for challenge response errors */
}

.error-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.error-message p {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: #721c24;
  text-align: center;
}

.success-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  margin-top: 24px;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  animation: slideInUp 0.5s ease-out;
}

.success-message-challenge-res {
  /* Additional specific styling for challenge response success */
}

.success-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.success-message p {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: #155724;
  text-align: center;
}

/* ============================================
   Toast Notifications
   ============================================ */

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  width: 100%;
  padding: 0 16px;
}

#toast-container .alert {
  margin-bottom: 0;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#toast-container .alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

#toast-container .alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

#toast-container .alert-info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

#toast-container .alert-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
}

#toast-container .btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#toast-container .btn-close:hover {
  opacity: 0.75;
}

#toast-container .btn-close::before {
  content: "×";
  font-size: 1.5rem;
}

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 576px) {
  body {
    padding: 0px;
  }
  .inner-container {
    width: 80%;
    padding: 16px;
  }

  .primary-input {
    font-size: 1rem;
    height: 50px;
    margin-bottom: 16px;
  }

  .primary-button {
    font-size: 1rem;
  }

  .factor-icon {
    width: 120px;
    height: 120px;
  }
}
