/* Reset and global styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

body {
    font-weight: 400;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; /* Improve font rendering on mobile */
}

html {
    direction: ltr !important;
}

h1, h2, tr, td, body, button {
    font-family: 'Funnel Display', sans-serif;
}

/* Fixed blurred background - only shown during analysis */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(12px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: none;
    will-change: opacity; /* Optimize for mobile performance */
}

.background-overlay.active {
    opacity: 1;
    display: block;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 1000;
}

.app-header.visible {
  display: flex !important;
  flex-direction: row;
}


.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  height: 28px;
}

.app-title {
  font-family: "Funnel Display", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #004b35;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right, a{
    text-decoration: none;
}

.header-h3 {
    font-weight: 600;
    font-size: 14px;
    color: #004b35;
    font-family: "Funnel Display", sans-serif;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #004b35;
}

.icon-btn:hover {
  opacity: 0.7;
}

.icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.map-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.map-loader.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: #027753;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loadingStatusText {
  color: #027753;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}


.map {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  margin-top: 40px;
}

.mapModal {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: auto !important;
  display: none;
  background: rgba(0, 0, 0, 0.2);
  justify-content: center !important;
  align-items: flex-end !important;
  z-index: 9999;
}

.mapModal.active {
  display: flex;
}


.modal-content {
  position: relative;
  background: white;
  border-radius: 10px;
  padding: 20px;
  max-width: 400px;
  margin: auto;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}


.modal-content img {
  width: 50%;
  border-radius: 10px;
  margin-bottom: 12px;
  object-fit: cover;
  max-height: 120px;
}


@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 12px;
}

.modal-content button {
  width: 100%;
  background-color: #027753;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 0;
  font-weight: 500;
  cursor: pointer;
}


.close-modal {
  font-size: 28px;
  float: right;
  cursor: pointer;
  color: #027753;
}


.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 50px);
    width: 100vw;
    position: relative;
    background: #EAF8F4;
    padding-top: 50px;
    direction: ltr !important;
}

.container.analysis-mode {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    background: transparent !important;
    width: 100vw !important;
    min-height: calc(100vh - 50px) !important;
    height: auto !important;
    direction: ltr !important;
    overflow: hidden !important;
    padding: 10px !important;
    margin-top: 50px;
    gap: 10px !important;
}

.main-content {
    position: relative;
    flex: 1 1 60%;
    max-width: 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

/* Upload view specific styles */
.upload-view .main-content, .error-view .main-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    background: #EAF8F4;
    justify-content: center;
}

/* Analysis state adjustments */
.container.analysis-mode .main-content {
    background: transparent !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    order: 2 !important;
}

.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    flex: 1 1 40%;
    max-width: 40%;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: static;
    transform: none;
    transition: none;
    position: sticky; 
    top: 50px; 
    order: 1 !important;
    margin: 0 !important;
    flex-shrink: 0;
}

#sidebarContent {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insightsContainer-style {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar.visible {
    transform: none;
}

/* Ensure Dig Deeper mode fills the sidebar height */
.sidebar.dig-deeper-mode {
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: 20px !important;
    margin: 0 !important;
    gap: 16px !important;
    /*height: 100%;*/
    overflow-y: auto; /* Ensure sidebar itself can scroll if content overflows */
}

/* Adjust the detailed insight card in Dig Deeper mode */
.detailed-insight-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-radius: 12px;
    margin: 0 !important;
    width: 100%;
    box-sizing: border-box;
    flex: 0 0 auto; /* Prevent uncontrolled growth */
    /*max-height: 100%;*/ /* Constrain height within parent */
    overflow-y: auto; /* Allow scrolling within the card if content overflows */
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Image container for overlaying emojis */
.image-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

/* Emoji overlay styles */
.icon-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Emoji styles with tooltip */
.emoji {
    position: absolute;
    font-size: 24px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    contain: content;
}

.emoji svg {
    width: 100%;
    height: 100%;
}

.emoji.highlighted {
    border: 2px solid white;
    border-radius: 50%;
    padding: 2px;
}

/* Tooltip on emoji hover */
.emoji:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Analysis questions */
.survey-container {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent; 
  overflow: hidden;
  z-index: 1000;
}

/* Background map layer */
.map-background {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: #ddd; /* fallback */
  background-size: cover;
  background-position: center;
  filter: grayscale(40%) brightness(0.8);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.map-background.active {
  opacity: 1;
}

.header-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-close-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-close-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}


.survey-header {
  position: absolute;
  bottom: 14rem;
  left: 0;
  z-index: 2;
  max-width: 400px;
  width: 90%;
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  margin: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  font-size: 16px;
  color: #181D27;
  position: relative;
}

.loading-icon {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #016143;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: loading-spinner-rotate 1s linear infinite;
}

/* Survey card */
.survey-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 400px;
  width: 90%;
  background: #fff;
  padding: 24px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  text-align: start;
  z-index: 2;
  display: none;
}

.survey-card.active {
  display: block;
}


/* Titles */
.survey-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

/* Option buttons */
.option-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-bottom: 15px;
}

/* Hide native radio appearance */
.option-btn input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease-in-out;
  background: #fff;
}

/* When checked, circle turns green */
.option-btn input[type="radio"]:checked {
  border-color: #22c55e;
  background-color: #22c55e;
}

/* White checkmark inside circle */
.option-btn input[type="radio"]:checked::after {
  content: "✔";
  position: absolute;
  color: #fff;
  font-size: 14px;
  top: -2px;
  left: 3px;
}

/* Highlight card when radio is checked */
.option-btn:has(input[type="radio"]:checked) {
  background: #dcfce7;   /* light green */
  border: 2px solid #22c55e;
  font-weight: 500;
}

.option-text{
    display: flex;
    gap: 14px;
}

.option-btn .checkmark {
  display: none; 
  color: #22c55e;
  font-size: 18px;
  font-weight: bold;
}

.option-btn.selected {
  background: #dcfce7;
  border: 2px solid #22c55e;
  font-weight: 500;
}

.option-btn.selected .checkmark {
  display: inline;
}

/* Navigation buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.nav-buttons button {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  width: 151px;
  height: 44px;
  color: #535862;
  border: none;

}

.back-btn {
  width: 151px;
  height: 44px;
  background: #fff;
  border: 2px solid #D5D7DA;
  border-radius: 12px;
  color: #414651;
}

.skip-btn {
  background: transparent;
  color: #666;
  border: none;
}

/* Final screen */
.survey-card[data-step="6"] {
  font-size: 18px;
  color: #1a1a1a;
}


/* Preview section styles */
.preview-content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.street-photo {
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    background: white;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    display: block !important;
    margin: auto;
    will-change: opacity; /* Optimize for mobile performance */
}

.street-photo.visible {
    opacity: 1;
}

.analysis-view {
    display: none;
    width: 100%;
    min-height: 100%;
}

.analysis-view.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.analysis-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: transparent;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 1000;
}

.analysis-header.visible {
  display: flex !important;
  flex-direction: row;
}


.analysis-header .left {
    background: white;
    width: 77px;
    height: 36px;
    border-radius: 999px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.analysis-header .right {
    background: white;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    /* display: flex; */
    justify-content: center;
    align-items: center;
    cursor: pointer;
}


.overview-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

.title {
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.subtitle {
    font-weight: 400;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.insight-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    cursor: pointer;
}

.header-text {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 500;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.insight-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

/* Tooltip on insight-icon hover */
.insight-icon:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.insight-title {
    font-weight: 600;
    font-size: 20px;
    color: #1a1a1a;
    overflow-wrap: break-word;
}

.insight-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    display:none;
}

.tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag.positive, 
.modal-tag.positive { 
    color: #059669; 
    border-color: #d1fae5;
    background-color: #d1fae5;
}

.tag.negative, 
.modal-tag.negative { 
    color: #dc2626; 
    border-color: #fee2e2;
    background-color: #fee2e2;
}

.tag.neutral, 
.modal-tag.neutral { 
    color: #f59e0b; 
    border-color: #fef3c7;
    background-color: #fef3c7;
}

/* Style the tag symbols (arrows) */
.tag-symbol.positive {
    color: #059669;
}

.tag-symbol.negative {
    color: #dc2626;
}

.tag-symbol.neutral {
    color: #f59e0b;
}

.insight-description {
    font-weight: 400;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 16px;
    overflow-wrap: break-word;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-insight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-insight-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.modal-insight-title {
    font-weight: 600;
    font-size: 20px;
    color: #1a1a1a;
    flex: 1;
    overflow-wrap: break-word;
}

.modal-insight-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    display:none;
}

.modal-tag {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid;
}

.detailed-description {
    font-weight: 400;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

/* Custom bullets for detailed description */
.detailed-description li {
    padding-left: 20px;
    list-style-type: none;
}

.detailed-description li::before {
    content: "• ";
    color: #666;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 120px;
    touch-action: manipulation; /* Prevent double-tap zoom on mobile */
}

.btn:active {
    transform: scale(0.98); /* Visual feedback on tap */
}

.btn-secondary {
    background-color: transparent;
    color: #016143;
    /* border: 1px solid #d1d5db; */
}

.btn-secondary:hover,
.btn-secondary:active {
    background-color: #e5e7eb;
}

.btn-dig-deeper {
    background-color: #D0EDE4;
    color: #065f46;
    /* border: 1px solid #D0EDE4; */
    transition: background-color 0.2s ease;
}

.btn-dig-deeper:hover,
.btn-dig-deeper:active {
    background-color: #a7f3d0;
}

.btn-dig-deeper:focus {
    outline: 2px solid #a7f3d0;
    outline-offset: 2px;
}

.btn-back {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    margin-bottom: 16px !important;
    margin-top: 0 !important;
    width: 100%;
    max-width: none;
    transition: all 0.2s ease;
}

.btn-back:hover,
.btn-back:active {
    background-color: #e5e7eb;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.final-feedback-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.feedback-input-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.feedback-textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: vertical;
  /* margin-top: 3px; */
}

.feedback-textarea:focus {
  outline: none;
  border-color: #999;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.final-card .action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.final-card .btn {
  width: 100%;
  max-width: 440px;
  margin-bottom: 10px;
}

.insight-subtitle {
    margin-top: 13px;
    margin-bottom: 13px;
}

.btn {
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Button variants */
 .btn-primary {
  background-color: #D0EDE4;
  color: #016143;
}

.btn-primary:hover {
  background-color: #bff0e3;
}

 .btn-feedback {
  background-color: #fff;
  border: 1px solid #D5D7DA;
  color: #414651;
}

.btn-feedback:hover {
  background-color: #f5f5f5;
}

.btn-danger {
  background-color: #fff;
  color: #535862;
}

.btn-danger:hover {
  background-color: #fdecea;
}


/* Upload styles */
.upload-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #EAF8F4;
    padding: 40px 20px;
    border: none;
    border-radius: 0;
    max-width: none;
    text-align: center;
    box-shadow: none;
    min-height: 100vh;
    width: 100%;
}

.error-view {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #EAF8F4;
    padding: 40px 20px;
    border: none;
    border-radius: 0;
    max-width: none;
    text-align: center;
    box-shadow: none;
    min-height: 100vh;
    width: 100%;
}

.error-view {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 40px 20px;
    border: none;
    border-radius: 0;
    max-width: none;
    text-align: center;
    box-shadow: none;
    min-height: 100vh;
    width: 100%;
}

.upload-view.hidden, .error-view.hidden {
    display: none;
}

.photo-upload-area, .photo-error-area {
    text-align: center;
    padding: 60px 40px;
    background: #ffffff;
    /* border: 2px dashed #d1d5db; */
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 24px;
}

.camera-icon, .error-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #9ca3af;
}

.icon-circle {
  background: #d4f5e9;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  margin: 0 auto 1rem auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.icon-circle i {
  color: #2ecc71;
  font-size: 28px;
}

.upload-title, .error-title {
    font-weight: 500;
    font-size: 20px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.upload-subtitle, .error-subtitle {
    font-weight: 400;
    color: #191919;
    font-size: 18px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.home-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.upload {
    background: #D0EDE4;
    border-radius: 12px;
}

.explore {
    background: #ffffff;
    border: 1px solid #D5D7DA;
    border-radius: 12px;
}

.btn-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-height: 44px;
    background: #D0EDE4;
}

.btn-explore {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-height: 44px;
    background: #ffffff;
}

.btn-take-photo {
    background-color: #059669;
    color: white;
}

.btn-take-photo:hover,
.btn-take-photo:active {
    background-color: #047857;
}

.btn-upload-photo {
    background-color: #D0EDE4;
    color: #374151;
    /* border: 1px solid #d1d5db; */
    position: relative;
}

.btn-upload-photo:hover,
.btn-upload-photo:active {
    background-color: #D0EDE4;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
}

.image-preview {
    margin: 20px 0;
    text-align: center;
}

.image-preview img {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.btn-continue {
    width: 100%;
    max-width: 500px;
    padding: 12px;
    background-color: #a7f3d0;
    color: #065f46;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.btn-continue:hover,
.btn-continue:active {
    background-color: #86efac;
}

.btn-continue:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
    color: #9ca3af;
    display: none;
}

/* Feedback Modal */
.modal {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 480px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(8px) saturate(180%); 
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation; /* Prevent double-tap zoom on mobile */
}

.modal-close:active {
    transform: scale(0.95); /* Visual feedback on tap */
}

.modal-title {
    font-weight: 600;
    font-size: 20px;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-weight: 400;
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.star {
    font-size: 32px;
    color: #e5e7eb;
    cursor: pointer;
    transition: color 0.2s;
    touch-action: manipulation; /* Prevent double-tap zoom on mobile */
}

.star:hover,
.star.active {
    color: #fbbf24;
}

.star:active {
    transform: scale(0.95); /* Visual feedback on tap */
}

.feedback-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 24px;
}

.feedback-textarea::placeholder {
    color: #9ca3af;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}


/* Share Input */
.feedback-buttons {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
}

.feedback-btn {
  color: #414651;
  flex: 1;
  padding: 10px;
  border: 1px solid #D5D7DA;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;

}

.feedback-btn.yes{
    border-radius: 8px 0px 0px 8px;
}
.feedback-btn.no{
    border-radius: 0px 8px 8px 0px;
}

.feedback-btn.active {
  background-color: #d1fae5;
  border-color: #D0EDE4;
}

.feedback-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.share-input-section {
  margin-top: 1rem;
}

.share-input-section textarea {
  width: 100%;
  height: 80px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.5rem;
  resize: none;
  outline: none;
  font-size: 14px;
}

.hidden {
  display: none;
}

.btn-submit {
  margin-top: 1rem;
  background-color: #F2F2F2;
  color: #B3B3B3;
  border: none;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.6;
}

.btn-submit.enabled {
  opacity: 1;
  background-color: #D0EDE4;
  color: #016143;
}

.btn-cancels {
  margin-top: 1rem;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
}

@keyframes fadeIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Loading Screen Styles */
.loading-screen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5; /* Match body background */
    z-index: 3000; /* Above all other elements */
}

.loading-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #059669; /* Match theme color (positive green) */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: loading-spinner-rotate 1s linear infinite;
}

@keyframes loading-spinner-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-status-text {
    margin-top: 20px;
    font-size: 20px;
    color: #333;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 12px;
    font-family: 'Funnel Display', sans-serif;
    text-align: center;
}

/* Media Query for Large Screens (e.g., >1200px) */
@media (min-width: 1201px) {
    .container.analysis-mode {
        padding: 20px !important;
        gap: 20px !important;
    }

    .main-content {
        flex: 1 1 65%;
        max-width: 65%;
    }

    .sidebar {
        flex: 1 1 35%;
        max-width: 35%;
        padding: 25px;
    }

    .image-container {
        max-width: 700px;
    }

    .street-photo {
        max-width: 700px;
        max-height: 85vh;
        padding: 15px;
    }

    .icon-overlay {
        top: 15px;
        left: 15px;
        right: 15px;
        bottom: 15px;
    }

    .emoji {
        font-size: 28px;
        width: 36px;
        height: 36px;
    }

    .emoji:hover::after {
        display: block; /* Ensure tooltip is visible on hover */
    }

    .detailed-insight-card {
        padding: 24px;
    }

    .modal-insight-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .modal-insight-title {
        font-size: 24px;
        font-weight: 700;
    }

    .modal-insight-tags {
        margin-bottom: 20px;
    }

    .modal-tag {
        padding: 8px 14px;
        font-size: 16px;
    }

    .detailed-description {
        font-size: 18px;
        line-height: 1.7;
    }

    .loading-spinner {
        width: 70px;
        height: 70px;
        border-width: 10px;
    }

    .loading-status-text {
        font-size: 24px;
        padding: 25px;
    }
}

/* Media Query for Medium Screens (e.g., 769px to 1200px) */
@media (max-width: 1200px) {
    .main-content {
        flex: 1 1 60%;
        max-width: 60%;
    }

    .sidebar {
        flex: 1 1 40%;
        max-width: 40%;
        padding: 15px;
    }

    .image-container {
        max-width: 500px;
    }

    .street-photo {
        max-width: 500px;
        max-height: 75vh;
        padding: 10px;
    }

    .icon-overlay {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .emoji {
        font-size: 22px;
        width: 30px;
        height: 30px;
    }

    /* // don't go responsive on font size. 
    .insight-title {
        font-size: 15px;
    }

    .insight-description {
        font-size: 13px;
    }

    .detailed-insight-card {
        padding: 20px;
    }

    .modal-insight-title {
        font-size: 22px;
    }
    */ 

    .modal-insight-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .modal-tag {
        padding: 6px 12px;
        font-size: 14px;
    }

    .detailed-description {
        font-size: 16px;
        line-height: 1.6;
    }

    .loading-spinner {
        width: 60px;
        height: 60px;
        border-width: 8px;
    }

    .loading-status-text {
        font-size: 20px;
        padding: 20px;
    }
}

/* Media Query for Small Screens (e.g., 481px to 768px) */
/* this is our mobile view - do the pointer thing to isolate mobile devices. */ 
@media ((max-width: 768px) and (pointer: coarse)) {
    .container.analysis-mode {
        flex-direction: column !important;
        padding: 10px !important;
        gap: 35px !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
    }

    .main-content {
        flex: 0 0 auto;
        max-width: 100%;
        order: 1 !important;
        max-height: 50vh;
    }

    .sidebar {
        flex: 1;
        max-width: 100%;
        padding: 15px;
        order: 2 !important;
        max-height: 500px;
        overflow-y: auto;
        position: relative;
        background-color: transparent;
        backdrop-filter: blur(0px);
        /* border-radius: 0px; */
        box-shadow: none;
        margin-bottom: 60px; /* Space for nav-arrows */
        min-height: 200px; /* Prevent collapsing on short screens */
    }

    /* Make sidebar content a horizontal swipeable area */
    #sidebarContent {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        /*-webkit-overflow-scrolling: touch;*/
        scrollbar-width: none;
        /*touch-action: pan-x;*/ /* Allow horizontal swiping */
        width: 100%;
        box-sizing: border-box;
    }

    #sidebarContent::-webkit-scrollbar {
        display: none;
    }

    .insightsContainer-style {
        display: flex;
        flex-direction: row;
        gap: 12px;
        width: 100%;

    }

    /* Override for Dig Deeper mode to prevent horizontal swiping */
    .sidebar.dig-deeper-mode #sidebarContent,
    .sidebar.dig-deeper-mode .insightsContainer-style {
        flex-direction: column;
        overflow-x: hidden; /* Disable horizontal scrolling */
        width: 100%;
    }

    .image-container {
        max-width: 100%;
    }

    .street-photo {
        max-width: 100%;
        max-height: 45vh; /* Reduced to fit short screens */
        padding: 8px;
    }

    .icon-overlay {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .emoji {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }

    /* Disable emoji tooltips on mobile to avoid hover issues */
    .emoji:hover::after {
        display: none;
    }

    /* Add tap effect for emojis */
    .emoji:active {
        transform: translate(-50%, -50%) scale(0.95);
    }

    .overview-card,
    .insight-card {
        flex: 0 0 auto;
        max-width: calc(85% - 32px); /* Subtract padding (15px * 2) and border (1px * 2) */
        width: calc(85% - 32px); /* Ensure it fits within the parent */
        min-width: 0; /* Allow shrinking */
        padding: 15px;
        margin-bottom: 0;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        background: #ffffff;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        scroll-snap-align: center;
        /*touch-action: pan-x;*/  /* Restrict to horizontal touch */
        overflow: hidden; /* Prevent internal overflow */
    }

    /* Stack content vertically within cards */
    .insight-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .insight-tags {
        /*flex-direction: column;*/
        gap: 4px;
    }

    .insight-title,
    .insight-description {
        overflow-wrap: break-word;
    }

    /* Add tap effect for cards */
    /* I don't think we need this  */
/*
    .overview-card:active,
    .insight-card:active {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
        background-color: #f9fafb; *//* Subtle background change on tap */
    /*}*/

    /* Navigation Arrows for Swiping */
    .nav-arrows {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        justify-content: center;
        gap: 20px;
        padding: 10px 0;
        z-index: 2000; /* Above all other elements */
        pointer-events: none;
        width: 100%;
        max-width: 300px; /* Prevent arrows from stretching too wide */
    }

    /* Hide nav arrows in Dig Deeper mode */
    .sidebar.dig-deeper-mode + .nav-arrows {
        display: none;
    }

    .arrow {
        background: rgba(0, 0, 0, 0.6); /* Slightly darker for better visibility */
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.2s ease, transform 0.2s ease;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); /* Stronger shadow for depth */
        pointer-events: auto;
        z-index: 2001;
        touch-action: manipulation; /* Prevent double-tap zoom on mobile */
    }

    .arrow:active {
        background: rgba(0, 0, 0, 0.8);
        transform: scale(0.95); /* Visual feedback on tap */
    }

    .arrow:disabled {
        background: rgba(0, 0, 0, 0.3);
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

    .arrow-left::before {
        content: '';
        display: inline-block;
        width: 20px;
        height: 20px;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>');
        background-size: contain;
        background-repeat: no-repeat;
    }

    .arrow-right::before {
        content: '';
        display: inline-block;
        width: 20px;
        height: 20px;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"/></svg>');
        background-size: contain;
        background-repeat: no-repeat;
    }

    /*
    .insight-title {
        font-size: 14px;
    }

    .insight-description {
        font-size: 12px;
    }
    */ 

    .btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 44px; /* Ensure accessibility for tap targets */
        min-width: 100px;
    }

    .action-buttons {
        gap: 8px;
        flex-direction: row;
    }

    .action-buttons .btn {
        margin-top: 20px;
    }

    .detailed-insight-card {
        padding: 15px;
        flex: 0 0 auto;
        max-width: 100%; /* Full width in Dig Deeper mode */
        width: 100%;
        min-width: 0;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        scroll-snap-align: none; /* Disable snapping in Dig Deeper mode */
        /*overflow-y: auto;
        max-height: calc(50vh - 90px); */ /* Account for sidebar padding and margins */
    }

    /*
    .modal-insight-title {
        font-size: 20px;
    }
    */ 

    .modal-insight-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .modal-tag {
        padding: 5px 10px;
        font-size: 13px;
    }

    .detailed-description {
        font-size: 14px;
        line-height: 1.5;
    }

    .image-preview img {
        max-width: 300px;
        height: 180px;
    }

    .photo-upload-area {
        padding: 40px 20px;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
        border-width: 6px;
    }

    .loading-status-text {
        font-size: 18px;
        padding: 15px;
        max-width: 80%;
    }
}


/* Hide navigation arrows on desktop and disable touch-specific styles */
@media (min-width: 769px) {
    .nav-arrows {
        display: none;
    }

    /* Disable touch-specific styles on desktop */
    .overview-card:active,
    .insight-card:active {
        transform: none;
        background-color: white;
    }

    .btn:active {
        transform: none;
    }

    .arrow:active {
        transform: none;
    }

    .emoji:active {
        transform: translate(-50%, -50%);
    }

    .modal-close:active,
    .star:active {
        transform: none;
    }
}

/* Ensure smooth scrolling on iOS */
@supports (-webkit-overflow-scrolling: touch) {
    html, body {
        /*overscroll-behavior: none;*/ /* Prevent bounce effect */
    }
}