/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ADAPTED: Soft blue gradient inspired by La Meva Salut's calming healthcare aesthetic */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  /* Changed from green to soft blue gradient matching healthcare theme */
  background: linear-gradient(180deg, #a8c8e8 0%, #e8f4f8 100%);
  padding: 1rem;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
}

/* ADAPTED: Header with clean, minimal styling like La Meva Salut */
.header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  /* Subtle background like the site's top bar */
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 0.75rem;
}

.header h1 {
  font-size: 2.5rem;
  /* Changed to darker text for better readability on light background */
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  /* Subtle shadow instead of harsh drop shadow */
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1);
  font-weight: 400;
}

.header p {
  /* Softer text color matching the site's body text */
  color: #4a4a4a;
  font-size: 1.1rem;
  font-weight: 300;
}

/* Loading State */
.loading {
  text-align: center;
  /* Changed to dark text for light background */
  color: #4a4a4a;
  font-size: 1.5rem;
  padding: 4rem;
}

/* ADAPTED: Error box with softer, more professional styling */
.error-box {
  /* Softer red background */
  background: rgba(255, 240, 240, 0.9);
  border: 2px solid #e57373;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.error-box h2 {
  color: #c62828;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.error-box p {
  color: #5f5f5f;
  margin-bottom: 1.5rem;
}

/* ADAPTED: Inventory with clean white card style */
.inventory {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  /* Subtle border like La Meva Salut cards */
  border: 1px solid rgba(168, 200, 232, 0.3);
  border-radius: 0.75rem;
  /* Minimal shadow for depth */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: none;
}

.inventory.visible {
  display: block;
}

.inventory-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Darker text for contrast */
  color: #2c2c2c;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.inventory-icon {
  width: 20px;
  height: 20px;
}

.inventory-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ADAPTED: Inventory items with soft blue badges like the site's icons */
.inventory-item {
  background: rgba(168, 200, 232, 0.25);
  border: 1px solid rgba(168, 200, 232, 0.4);
  color: #2c5282;
  padding: 0.375rem 0.875rem;
  border-radius: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ADAPTED: Card Container with clean white design */
.card {
  /* Clean white background like La Meva Salut main content */
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 0.75rem;
  /* Subtle shadow matching the reference site */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: none;
}

.card.visible {
  display: block;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ADAPTED: Card Header with subtle blue gradient */
.card-header {
  /* Softer blue gradient inspired by the site's header */
  background: linear-gradient(135deg, #93b8d9 0%, #a8c8e8 100%);
  padding: 2rem;
}

.card-title {
  font-size: 2rem;
  color: #1a1a1a;
  font-weight: 500;
}

/* Card Content */
.card-content {
  padding: 2rem;
}

.card-text {
  color: #374151;
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}

/* Choices Section */
.choices-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ADAPTED: Choice buttons matching La Meva Salut's button styles */
.choice-button {
  width: 100%;
  text-align: left;
  /* Clean white/light blue background like "Conèixer els serveis" button */
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #a8c8e8;
  border-radius: 0.5rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  color: #1f2937;
  font-weight: 500;
  /* Subtle shadow */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ADAPTED: Hover state inspired by the "Entrar" primary button */
.choice-button:hover {
  background: linear-gradient(135deg, #7db3e8 0%, #93b8d9 100%);
  border-color: #7db3e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(125, 179, 232, 0.3);
  color: #1a1a1a;
}

.choice-button:active {
  transform: translateY(0);
}

.choice-reward {
  color: #7db3e8;
  font-size: 0.875rem;
  margin-left: 0.5rem;
  font-weight: 600;
}

/* ADAPTED: End Game Screen with clean white card design */
.end-screen {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 3rem;
  text-align: center;
  display: none;
}

.end-screen.visible {
  display: block;
  animation: fadeIn 0.5s ease-in;
}

.end-title {
  font-size: 2.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.end-title.victory {
  color: #4caf50;
}

.end-title.gameover {
  color: #e57373;
}

.end-message {
  color: #374151;
  font-size: 1.25rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.end-inventory {
  margin-bottom: 2rem;
}

.end-inventory-label {
  color: #6b7280;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.end-inventory-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* ADAPTED: Inventory items with soft blue badges */
.end-inventory-item {
  background: rgba(168, 200, 232, 0.25);
  color: #2c5282;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(168, 200, 232, 0.4);
}

/* ADAPTED: Primary button matching La Meva Salut's "Entrar" button */
.btn-primary {
  /* Solid blue background like the primary CTA */
  background: #7db3e8;
  color: #1a1a1a;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(125, 179, 232, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: #6ba3d8;
  box-shadow: 0 4px 12px rgba(125, 179, 232, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.restart-footer {
  text-align: center;
  margin-top: 1.5rem;
}

/* ADAPTED: Secondary button style */
.btn-restart-small {
  color: #5f5f5f;
  background: transparent;
  border: 1px solid #d0d0d0;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-restart-small:hover {
  color: #2c2c2c;
  border-color: #a8c8e8;
  background: rgba(168, 200, 232, 0.1);
}

.icon {
  width: 20px;
  height: 20px;
}

/* ADAPTED: Progress indicator with notification bar styling */
.progress-indicator {
  /* Light beige/cream background like the notification bar */
  background: rgba(255, 250, 235, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(168, 200, 232, 0.3);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.progress-indicator.visible {
  display: block;
}

.progress-text {
  color: #4a4a4a;
  font-size: 0.875rem;
  text-align: center;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .card-header {
    padding: 1.5rem;
  }

  .card-title {
    font-size: 1.5rem;
  }

  .card-content {
    padding: 1.5rem;
  }

  .end-screen {
    padding: 2rem;
  }

  .end-title {
    font-size: 2rem;
  }
}

/* Hidden utility class */
.hidden {
  display: none !important;
}

/* ADAPTED: Additional utility classes inspired by La Meva Salut */

/* Icon badge containers like "Consultes urgents" at bottom */
.info-badges {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.info-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(168, 200, 232, 0.3);
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  font-size: 0.875rem;
  font-weight: 500;
  color: #2c2c2c;
}

.info-badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.info-badge-icon.blue {
  background: #7db3e8;
  color: white;
}

.info-badge-icon.red {
  background: #e57373;
  color: white;
}
/* Progress bar styles */
.progress-bar-container {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  padding: 0 20px;
}

.progress-bar-wrapper {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  height: 30px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6fea66 0%, #4ba24e 100%);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  position: relative;
}

.progress-bar-text {
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: absolute;
  right: 10px;
  z-index: 1;
}

.progress-bar-bg-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.5);
  font-weight: bold;
  font-size: 14px;
  z-index: 0;
}

/* Game over GIF styles */
.gameover-gif {
  width: 100%;
  max-width: 400px;
  margin: 20px auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
