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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f0f2f5;
  color: #303030;
  line-height: 1.6;
}

.container {
  max-width: 1280px;
  margin: 2rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eaeef2;
  position: relative;
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
  color: #1e3a8a;
  font-weight: 700;
  letter-spacing: -0.025em;
}

header p {
  color: #6b7280;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-video-container {
  width: 100%;
  height: 300px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  position: relative;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Form Controls */
.input-area {
  margin-bottom: 2rem;
  border-bottom: 1px solid #eaeef2;
  padding-bottom: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.2rem;
  justify-content: center;
  align-items: center;
  background: linear-gradient(96deg, #f6f8fd 60%, #e8f0fe 100%);
  box-shadow: 0 0px 30px 0 rgba(28,51,120,0.035);
  border-radius: 1.2rem;
  position: relative;
}

.input-area .form-group {
  flex: 1 1 285px;
  min-width: 260px;
  max-width: 350px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.input-area label {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.54rem;
  color: #3751b0;
  letter-spacing: 0.01em;
}

.input-area input[type="text"], 
.input-area textarea {
  padding: 0.63rem 1.03rem;
  font-size: 1.08rem;
  border: 1.5px solid #bcd2ff;
  background: #fdfbff;
  border-radius: 0.7rem;
  box-shadow: 0 1px 5px 0 #c2d3ff16;
  transition: border 0.17s, box-shadow 0.14s;
}
.input-area input:focus,
.input-area textarea:focus {
  border: 1.8px solid #385cda;
  box-shadow: 0 2px 14px #9eb7ff29;
  outline: none;
}

.input-area textarea {
  min-height: 44px;
  font-size: 1.04rem;
  resize: vertical;
}

#analyze-button, #back-button {
  width: 100%;
  max-width: 200px;
  margin-top: 1.1rem;
  font-size: 1.12rem;
  font-weight: 600;
}

#analyze-button {
  background: linear-gradient(94deg, #385cda 60%, #31a8f3 100%);
  box-shadow: 0 3px 18px 0 rgba(49,168,243,0.09);
  border-radius: 5rem;
  letter-spacing: 0.085em;
  margin-right: 0.45rem;
  padding: 0.85rem 0;
  border: none;
  transition: background 0.18s, box-shadow 0.13s, transform 0.13s;
}
#analyze-button:hover {
  background: linear-gradient(93deg,#2651c2 55%, #2295e1 100%);
  transform: translateY(-2px) scale(1.03);
}

#back-button {
  background: rgba(55,91,173,0.11);
  color: #3351aa;
  border: 1.5px solid #8ab6e9;
  transition: background 0.13s, color 0.13s, border 0.13s, transform 0.12s;
  border-radius: 5rem;
  margin-left: 0.45rem;
  padding: 0.85rem 0;
  font-size: 1.04rem;
}
#back-button:hover {
  background: #e0e9ff;
  color: #243880;
  border: 1.5px solid #6284d5;
  transform: translateY(-1px) scale(1.02);
}

.input-area .form-group textarea,
.input-area .form-group input[type="text"] {
  margin-bottom: 0.5rem;
}

.input-area .form-group:last-child {
  margin-right: 0;
}

/* Responsive adjustments for input-area */
@media (max-width: 900px) {
  .input-area {
    flex-direction: column;
    gap: 1.2rem;
    padding-bottom: 1.5rem;
  }
  .input-area .form-group {
    min-width: 175px;
    max-width: unset;
  }
}

@media (max-width: 500px) {
  .input-area {
    padding: 0.81rem 0.12rem 1.2rem 0.12rem;
    border-radius: 0.8rem;
    gap: 0.7rem 0;
  }
  .input-area .form-group {
    min-width: 120px;
  }
  #analyze-button, #back-button {
    max-width: 99vw;
    font-size: 1.01rem;
  }
}

/* Place autocomplete list nicely aligned with input */
#province-autocomplete-list {
  left: 0;
  right: auto;
  width: 100% !important;
  max-width: 99vw;
  min-width: 220px;
  border-radius: 0.7rem;
}

/* Visual feedback for required fields not filled */
.input-area input:invalid, .input-area textarea:invalid {
  border-color: #ef4444;
  background: #fdf5f6;
}

/* Add a soft fade-in on input section */
.input-area {
  animation: fadePop 0.55s cubic-bezier(.52,-0.19,.49,1.02);
}
@keyframes fadePop {
  from { opacity: 0; transform: scale(0.99) translateY(18px);}
  to { opacity: 1; transform: scale(1) translateY(0);}
}

/* Button Styles */
button {
  background: #4f46e5;
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

button:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Progress Bar Styles */
.progress-container {
  margin: 1rem 0;
  display: none;
  width: 100%;
}

.progress-bar {
  height: 8px;
  background: #e0e7ff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #818cf8);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  color: #4b5563;
  font-size: 0.9rem;
}

.time-remaining {
  font-weight: 500;
  color: #1e3a8a;
}

/* Loading Indicator */
.loading-indicator {
  text-align: center;
  color: #6b7280;
  display: none;
  margin: 2rem 0;
  font-weight: 500;
}

.loading-video-container {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1rem;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Removing old spinner animations */
.spinner {
  display: none;
}

/* Map Container */
#map {
  height: 500px;
  width: 100%;
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #eaeef2;
}

/* Results Area */
.results-area {
  margin-top: 2rem;
}

/* Location and Business Result Cards */
.location-results {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #eaeef2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.location-results h2 {
  margin-top: 0;
  font-size: 1.4rem;
  color: #1e3a8a;
  font-weight: 600;
  margin-bottom: 1rem;
}

.location-summary {
  padding: 1rem;
  background: #fff;
  border-radius: 0.5rem;
  border: 1px solid #eaeef2;
  margin-bottom: 1rem;
}

.simplified-business-list {
  background: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #eaeef2;
}

.simplified-business-list h3 {
  margin-top: 0;
  color: #374151;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.simplified-business-list table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.5rem;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.simplified-business-list th,
.simplified-business-list td {
  border: none;
  padding: 0.75rem 1rem;
  text-align: left;
}

.simplified-business-list th {
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.simplified-business-list tbody tr {
  background: #fff;
  transition: background-color 0.2s;
}

.simplified-business-list tbody tr:nth-child(even) {
  background: #f8fafc;
}

.simplified-business-list tbody tr:hover {
  background: #f0f9ff;
}

.simplified-business-list td {
  border-top: 1px solid #eaeef2;
}

.simplified-business-list ul {
  list-style-type: none;
  padding-left: 0;
}

/* City Summary */
.city-summary {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #eaeef2;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.city-summary h2 {
  margin-top: 0;
  color: #1e3a8a;
  font-size: 1.5rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid #eaeef2;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #374151;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dbe1e8;
  border-radius: 0.4rem;
  font-size: 0.9rem;
}

.summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.summary-table th,
.summary-table td {
  border: none;
  padding: 0.75rem 1rem;
  text-align: left;
}

.summary-table th {
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-table tbody tr {
  background: #fff;
  transition: background-color 0.2s;
}

.summary-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.summary-table tbody tr:hover {
  background: #f0f9ff;
}

.summary-table td {
  border-top: 1px solid #eaeef2;
}

/* Opportunity Indicator */
.opportunity-indicator {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.opportunity-high {
  background-color: #ecfdf5;
  color: #047857;
}

.opportunity-medium {
  background-color: #fffbeb;
  color: #92400e;
}

.opportunity-low {
  background-color: #f3f4f6;
  color: #4b5563;
}

/* Investigation button styling */
.investigate-btn {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.investigate-btn:hover {
  background: #4338ca;
}

/* Top Recommendations Section */
.recommendations-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f0f9ff;
  border-radius: 0.75rem;
  border: 1px solid #e0f2fe;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.recommendations-section h2 {
  color: #0369a1;
  margin-top: 0;
  font-size: 1.5rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 1.5rem;
  grid-column: 1 / -1;
}

.recommendation-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.recommendation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.recommendation-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #1e3a8a;
}

.recommendation-info p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.potential-score {
  font-weight: 600;
  color: #0369a1;
}

.recommendation-actions {
  margin-top: auto;
}

.view-on-map {
  width: 100%;
  background: #0284c7;
}

.view-on-map:hover {
  background: #0369a1;
}

/* Province Table Styles */
.province-table-container {
  background: linear-gradient(97deg, #f4f8ff 65%, #eef4fa 100%);
  box-shadow: 0 6px 28px rgba(48, 98, 161, 0.09);
  padding: 2.5rem 2.2rem 2rem 2.2rem;
  border: 1.5px solid #bcd3fd;
  border-radius: 1.3rem;
  position: relative;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.province-table-container h2 {
  color: #1443a6;
  font-size: 1.65rem;
  text-align: left;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin-bottom: 2.15rem;
  padding: 0 1rem;
  text-shadow: 0 2px 8px #dbeafe33, 0 1px 0 #fff;
}

.province-filter-controls {
  background: linear-gradient(99deg, #e6effc 80%, #fafdff 100%);
  border: none;
  border-radius: 1.1rem;
  box-shadow: 0 2px 13px #bae6fd13;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 1.1rem 2.4rem;
  margin-bottom: 0.7rem;
  margin-top: 0.5rem;
  padding: 1.35rem 1.8rem 1.2rem 1.8rem;
}

@media (max-width: 1000px) {
  .province-filter-controls {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1.1rem 0.6rem;
  }
}

.filter-section {
  background: none;
  border-radius: 0.6rem;
  padding: 0.1rem 0 0.1rem 0;
  gap: 0.53rem;
}

.filter-section label {
  font-weight: 600;
  color: #1e3a8a;
  font-size: 1rem;
  margin-bottom: 0.33rem;
}

.filter-section input,
.filter-section select {
  padding: 0.62rem 1.02rem;
  border: 1.5px solid #bddcff;
  border-radius: 0.42rem;
  font-size: 1.07rem;
  background: #f8fbff;
  transition: border 0.17s, background 0.13s;
  margin-bottom: 0.11rem;
}
.filter-section input:focus,
.filter-section select:focus {
  border: 1.9px solid #338bff;
  background: #f0faff;
}

.selection-controls {
  background: linear-gradient(92deg, #f0fbf5 25%, #f7faff 85%);
  border-radius: 0.5rem;
  gap: 1.3rem;
  border: 1.2px solid #bae6fd;
  padding: 1.05rem 1.12rem;
  margin-top: 1.15rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 1px 6px #bae6fd27;
  flex-wrap: wrap;
}

.selection-info {
  font-weight: 600;
  color: #0369a1;
  font-size: 1.01rem;
  margin-right: 1.12rem;
}

.selection-button {
  padding: 0.53rem 1.17rem;
  font-size: 0.97rem;
  background: #e0f2fe;
  color: #0369a1;
  border: 1.2px solid #bae6fd;
  font-weight: 500;
  border-radius: 0.42rem;
  margin-right: 0.13rem;
  margin-bottom: 0.12rem;
  transition: background 0.14s, color 0.13s, border 0.14s, box-shadow 0.14s, transform 0.13s;
  box-shadow: 0 1px 8px #bae6fd13;
}
.selection-button:hover, .selection-button.active {
  background: #bae6fd;
  color: #165d84;
  border: 1.2px solid #72bfeb;
  transform: translateY(-2px) scale(1.04);
}

.selection-button.primary {
  background: linear-gradient(92deg, #2dd4bf 90%, #d1fae5 180%);
  color: #05553f;
  font-weight: 700;
  border: 1.5px solid #34d399;
  box-shadow: 0 2px 18px #2dd4bf15;
}

.selection-button.primary:hover, .selection-button.primary:active {
  background: #09cdb3;
  color: #fff;
  border: 1.5px solid #059669;
}

.province-table {
  margin-top: 1.2rem;
  font-size: 1.04rem;
  border-radius: 0.67rem;
  overflow: hidden;
  box-shadow: 0 2px 13px #bde0fd14;
}

.province-table th,
.province-table td {
  padding: 0.86rem 1.19rem;
  border-top: none;
  background: #fff;
  vertical-align: middle;
}

.province-table th {
  background: #e6f0fd;
  color: #1858b6;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.97rem;
  border-bottom: 1.7px solid #dbeafe;
  border-top: none;
  text-align: center;
}

.province-table td {
  font-size: 1.01rem;
  color: #1e293b;
  text-align: center;
}
.province-table tbody tr:nth-child(even) {
  background: #eef6fa;
}

.province-table input[type="checkbox"] {
  accent-color: #2563eb;
  width: 1.25em; height: 1.25em;
  margin-right: 0.18em;
}

/* Map Button */
.province-table-container .selection-button,
.province-table-container .selection-button.primary {
  margin-bottom: 1rem;
  font-size: 1.09rem;
  border-radius: 0.56rem;
  padding: 0.71rem 1.29rem;
  letter-spacing: 0.01em;
  font-weight: 600;
}

/* Map Button: visually separate and special color */
.province-table-container > .selection-button {
  display: block;
  width: 200px;
  margin: 0 auto 1.35rem auto;
  background: #4338ca;
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px #638bff18;
  border-radius: 1.2em;
  transition: background 0.16s, box-shadow 0.16s, transform 0.13s;
}
.province-table-container > .selection-button:hover {
  background: #334155;
  color: #fff;
  transform: translateY(-1.5px) scale(1.03);
}

/* Responsive province table on mobile */
@media (max-width: 700px) {
  .province-table-container {
    padding: 1.1rem 0.25rem 0.8rem 0.25rem;
    border-radius: 0.8rem;
    min-width: 98vw;
  }
  .province-table {
    font-size: 0.93rem;
    border-radius: 0.4rem;
  }
  .province-table th,
  .province-table td {
    padding: 0.56rem 0.45rem;
    font-size: 0.93rem;
  }
  .province-filter-controls {
    border-radius: 0.6rem;
    padding: 0.5rem 0.5rem 0.6rem 0.5rem;
    gap: 0.7rem 0.21rem;
  }
  .selection-controls {
    border-radius: 0.5rem;
    padding: 0.6rem 0.55rem;
  }
  .province-table-container > .selection-button {
    width: 98%;
    margin: 0.13rem auto 1.08rem auto;
    font-size: 1rem;
  }
}

/* Segmented selector for gender filter */
#gender-filter {
  background: #f0f7ff;
  border: 1.3px solid #cbd5e1;
  border-radius: 0.38rem;
  color: #11408a;
  font-weight: 500;
  margin-top: 0.14rem;
}
#gender-filter option {
  font-weight: 500;
  color: #185e6d;
  background: #f0f7ff;
  padding: 0.2em 0.62em;
}

/* Counter badge for selected municipios */
.selection-info span#selected-count {
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 0.16em 0.8em;
  font-size: 1.02em;
  font-weight: 600;
  margin-right: 0.36em;
  display: inline-block;
}

@media (max-width: 450px) {
  .province-table th, .province-table td {
    padding: 0.42rem 0.13rem;
    font-size: 0.88rem;
  }
}

/* Checkbox column should not take much width */
.province-table th:first-child, .province-table td:first-child {
  width: 1.7em;
  min-width: 1.7em;
  padding-left: 0.78em;
  padding-right: 0.49em;
}

.province-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Highlight selected row for feedback */
.province-table tbody tr.selected {
  background: #c7f8fc !important;
  color: #133a56;
}

/* Disable select all/deselect all/continue if no rows visible */
.selection-button:disabled,
.selection-button[disabled] {
  opacity: 0.63;
  cursor: not-allowed;
}

/* Animation for province table block on entry */
.province-table-container {
  animation: fadePop 0.68s cubic-bezier(.54,-0.18,.47,1.07);
}

/* Soft shadow on input + filter controls */
.filter-section input,
.filter-section select {
  box-shadow: 0 1px 7px #90cdf433;
}

.province-table {
  box-shadow: 0 2px 18px #bcd2fd19;
}

/* ...existing code... */

/* Autocomplete input styling */
#province-autocomplete-list {
  position: absolute;
  z-index: 100;
  background: #fff;
  border: 1px solid #dbe1e8;
  border-radius: 0.5rem;
  margin-top: 0.3rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-height: 210px;
  overflow-y: auto;
  width: 100%;
  min-width: 220px;
  display: none;
}

#province-autocomplete-list .autocomplete-item {
  padding: 0.72rem 1.13rem;
  cursor: pointer;
  font-size: 1rem;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.16s;
}
#province-autocomplete-list .autocomplete-item:last-child {
  border-bottom: none;
}
#province-autocomplete-list .autocomplete-item:hover, 
#province-autocomplete-list .autocomplete-item.active {
  background: #f0f9ff;
}

/* Log Viewer Styles - Side Menu (Drawer) Format */
.log-viewer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 380px;
  max-width: 92vw;
  background: #fff;
  border-radius: 0 0 0 0.875rem;
  box-shadow: -7px 0 25px rgba(0,0,0,0.14), -2px 0 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  z-index: 1202;
  border-left: 1px solid #eaeef2;
  transform: translateX(100%);
  transition: transform 0.37s cubic-bezier(0.55, 0, 0.1, 1);
  pointer-events: none;
  opacity: 0;
}

.log-viewer.open {
  transform: translateX(0%);
  opacity: 1;
  pointer-events: initial;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem 1.2rem 1.1rem;
  background: #f8fafc;
  border-bottom: 1px solid #eaeef2;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1e293b;
}

.log-title {
  font-size: 1.15rem;
  color: #1e293b;
}

/* Toggle Button for Log Viewer (fixed on the side) */
#log-toggle-btn {
  position: fixed;
  top: 2.4rem;
  right: 0.88rem;
  z-index: 1203;
  background: #1e40af;
  color: #fff;
  border: none;
  outline: none;
  border-radius: 50% 0 0 50%;
  box-shadow: 0 2px 12px rgba(30, 64, 175, 0.12);
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, box-shadow 0.2s;
  font-size: 1.33rem;
}

#log-toggle-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.14);
}

.log-content {
  padding: 1rem 1.25rem 1.25rem 1.25rem;
  overflow-y: auto;
  flex: 1 1 auto;
  font-size: 0.96rem;
  background: #fff;
  max-height: unset;
}

/* Small close button in the log menu for mobile/desktop */
#log-close-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  margin-left: 0.8rem;
  cursor: pointer;
  color: #6b7280;
  opacity: 0.75;
  transition: color 0.16s, opacity 0.13s;
}
#log-close-btn:hover {
  color: #1e293b;
  opacity: 1;
}

/* Minimalist look inside the log */
.log-entry {
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.98rem;
}

/* More readable timestamp + slight font adjustments */
.timestamp {
  color: #64748b;
  font-size: 0.87rem;
  min-width: 68px;
  text-align: right;
  font-family: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
  margin-right: 0.4rem;
  margin-top: 0.1em;
  letter-spacing: 0.01em;
}

/* Scrollbars styled */
.log-content::-webkit-scrollbar {
  width: 7px;
}
.log-content::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 4px;
}

/* Responsive: Drawer overlays and shrinks on small screens */
@media (max-width: 700px) {
  .log-viewer {
    width: 98vw;
    max-width: 98vw;
    border-radius: 0;
  }
  #log-toggle-btn {
    top: 1.1rem;
    right: 0.32rem;
    width: 38px;
    height: 38px;
    font-size: 1.08rem;
  }
  #province-autocomplete-list {
    min-width: unset;
    width: 99vw;
    left: 0;
    right: 0;
    border-radius: 0.6rem;
  }
}

/* Custom potential level classes */
.potential-high { background-color: rgba(4, 120, 87, 0.1); }
.potential-medium { background-color: rgba(146, 64, 14, 0.1); }
.potential-low { background-color: rgba(156, 163, 175, 0.1); }

/* Responsive styles */
@media (max-width: 768px) {
  .container {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .recommendations-section {
    grid-template-columns: 1fr;
  }
  
  .filter-controls {
    flex-direction: column;
  }
  
  .log-viewer {
    width: calc(100% - 2rem);
    max-width: 400px;
  }
  .hero-video-container {
    height: 200px;
  }
}

/* International province message */
.international-province-message {
  margin: 2rem auto;
  padding: 2rem;
  background: #f0f9ff;
  border-radius: 0.75rem;
  border: 1px solid #bae6fd;
  text-align: center;
  max-width: 600px;
}

.international-province-message h2 {
  color: #0369a1;
  margin-top: 0;
  margin-bottom: 1rem;
}

.international-province-message p {
  margin-bottom: 1.5rem;
  color: #334155;
}

.international-province-message button {
  display: inline-block;
  background: #0284c7;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: background 0.2s;
}

.international-province-message button:hover {
  background: #0369a1;
}

/* --- Modal para OpenAI (búsquedas internacionales) --- */
.ai-modal {
  display: none;
  position: fixed;
  z-index: 1205;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  background: rgba(45, 48, 63, 0.27);
}

.ai-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-modal-content {
  background: #fff;
  padding: 2.2rem 2.1rem 2.1rem 2.1rem;
  border-radius: 1.1rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 36px rgba(0,0,0,0.18);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-modal-content h2 {
  margin-top: 0;
  text-align: center;
  font-size: 1.11rem;
  color: #1e3a8a;
  margin-bottom: 0.3rem;
}

.ai-modal-content label {
  font-weight: 500;
  color: #374151;
}

.ai-modal-content input[type="text"] {
  width: 100%;
  border: 1px solid #dbe1e8;
  padding: 0.56rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.ai-modal-content button {
  margin-top: 1.11rem;
  padding: 0.74rem 1.3rem;
  font-size: 1rem;
  width: 100%;
  border-radius: 0.6rem;
}

.ai-close {
  font-size: 1.7rem;
  position: absolute;
  right: 1.15rem;
  top: 0.6rem;
  color: #64748b;
  opacity: 0.67;
  cursor: pointer;
  transition: color 0.19s;
  border: none;
  background: none;
  z-index: 1;
}
.ai-close:hover {
  color: #1e3a8a;
  opacity: 1;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.03rem;
  color: #374151;
  margin: 1rem 0;
}

.ai-intl-results {
  margin-top: 1.3rem;
  font-size: 1rem;
  color: #1e293b;
  max-height: 240px;
  overflow-y: auto;
}

.ai-intl-results ul {
  padding-left: 1.3rem;
}

.ai-intl-results li {
  margin-bottom: 0.38rem;
}

#analyze-international-btn {
  display: none;
  background: #10b981;
  margin-top: 1.2rem;
}

#analyze-international-btn.active {
  display: inline-flex;
}

@media (max-width: 650px) {
  .ai-modal-content {
    max-width: 98vw;
    border-radius: 0.81rem;
    padding: 1.1rem;
  }
}

/* Prospecting configuration inside Prospect Modal */
.prospect-config {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.prospect-config label {
  font-weight: 500;
  color: #374151;
}
.prospect-config select,
.prospect-config textarea {
  padding: 0.5rem 0.75rem;
  border: 1px solid #dbe1e8;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  resize: vertical;
}

/* Back Button */
#back-button {
  display: none;
  width: 100%;
  max-width: 200px;
  margin: 1rem auto;
}

/* Prospect actions styling */
.prospect-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.prospect-actions button {
  background: #4f46e5;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
}
.prospect-actions button:hover {
  background: #4338ca;
}

/* Add at the end of the file */
.star-rating {
  font-size: 1rem;
  color: #fbbf24; /* Amber for stars */
  letter-spacing: 0.05em;
}

/* -------- Mejores Oportunidades Section: Agrupación y Destacado -------- */

/* Container for "Mejores Oportunidades" - group categories in a card-group */
.recommendation-groups-container {
  display: flex;
  justify-content: center;
  gap: 2.3rem;
  flex-wrap: wrap;
  margin-bottom: 2.6rem;
  padding: 2.2rem 0 1.1rem 0;
  background: linear-gradient(97deg, #f1f5ff 60%, #f0f4fa 100%);
  border-radius: 1.08rem;
  border: 1px solid #dbeafe;
  box-shadow: 0 3px 24px rgba(30,64,175,0.09);
  position: relative;
}

@media (max-width: 950px) {
  .recommendation-groups-container {
    flex-direction: column;
    gap: 2rem;
    padding: 1.2rem 0.7rem;
  }
}

/* Each group: High, Medium, Low */
.recommendation-group {
  flex: 1 1 280px;
  min-width: 270px;
  max-width: 355px;
  padding: 1.15rem 1.1rem 3.25rem 1.1rem;
  background: #fff;
  border-radius: 0.73rem;
  border: 1.5px solid #e0e7ef;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow: 0 5px 18px rgba(59,130,246,0.035);
  position: relative;
  min-height: 370px;
  margin-bottom: 1.2rem;
}

.recommendation-group.high {
  border: 2px solid #10b981;
  background: linear-gradient(98deg, #e5faf3 80%, #fafffe 100%);
}
.recommendation-group.medium {
  border: 2px solid #fbbf24;
  background: linear-gradient(98deg, #fef6e5 80%, #fffcf7 100%);
}
.recommendation-group.low {
  border: 2px solid #d1d5db;
  background: linear-gradient(98deg, #f8fafc 80%, #fcfdfe 100%);
}

.recommendation-group-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}

.recommendation-group-header .icon {
  font-size: 2.3rem;
  flex-shrink: 0;
}

.recommendation-group-header .label-high {
  color: #059669;
  font-weight: 700;
}
.recommendation-group-header .label-medium {
  color: #b45309;
  font-weight: 700;
}
.recommendation-group-header .label-low {
  color: #6b7280;
  font-weight: 600;
}

.recommendation-group .explain {
  font-size: 0.98rem;
  color: #475569;
  margin-bottom: 0.95rem;
  margin-top: -0.45rem;
}

.recommendation-cards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recommendation-card {
  background: #fff;
  border-radius: 0.6rem;
  border: 1px solid #e0e7ef;
  padding: 1rem 1rem 0.8rem 1rem;
  box-shadow: 0 1px 8px rgba(59,130,246,0.049);
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
  transition: box-shadow 0.22s, transform 0.22s;
  min-height: 132px;
  position: relative;
}
.recommendation-card:hover {
  box-shadow: 0 4px 12px rgba(38,90,190,0.13);
  transform: translateY(-3px) scale(1.01);
}

.recommendation-info h3 {
  font-size: 1.06rem;
  color: #1e3a8a;
  margin: 0;
  margin-bottom: 0.3rem;
  font-weight: 600;
  text-align: left;
}
.recommendation-info .business-population {
  color: #2d3748;
  font-size: 0.97rem;
  margin-bottom: 0.24rem;
}
.recommendation-info .potential-score {
  font-size: 1.07rem;
  font-weight: 600;
  color: #0e7490;
}
.recommendation-info p {
  margin-bottom: 0.14rem;
  font-size: 0.94rem;
}
.recommendation-info .potential-label {
  font-weight: 500;
  font-size: 0.89rem;
  margin-left: 0.25rem;
}
.recommendation-info .potential-label.high {
  color: #10b981;
}
.recommendation-info .potential-label.medium {
  color: #f59e42;
}
.recommendation-info .potential-label.low {
  color: #6b7280;
}
.recommendation-actions {
  margin-top: auto;
}
.view-on-map {
  width: 100%;
  background: #0284c7;
  color: #fff;
  border-radius: 0.41rem;
  font-size: 0.94rem;
  padding: 0.57rem 0;
  margin-top: 0.8rem;
  transition: background 0.19s;
}
.view-on-map:hover {
  background: #0369a1;
}

@media (max-width: 700px) {
  .recommendation-groups-container {
    padding: 0.8rem 3vw 0.5rem 3vw;
    border-radius: 0.7rem;
    gap: 1.2rem;
  }
  .recommendation-group {
    min-width: unset;
    max-width: unset;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
    min-height: 280px;
  }
}

@media (max-width: 510px) {
  .recommendation-group {
    min-width: unset;
    max-width: unset;
    padding: 0.4rem 0.09rem 1.75rem 0.3rem;
  }
}