/* public/style.css */

/* ————— Design Tokens ————— */
:root {
  --background-color: #121212;
  --card-color:       #1e1e1e;
  --primary-text-color:   #e0e0e0;
  --secondary-text-color: #b0b0b0;
  --accent-color:     #0d6efd;
  --accent-hover:     #0b5ed7;
  --input-background: #333333;
  --border-color:     #444444;
}

/* ————— Global ————— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--primary-text-color);
  min-height: 100vh;
}

/* ————— Screens & Visibility ————— */
.screen {
  width: 100%;
  height: 100vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;                         /* ← allow scrolling when content overflows */
  -webkit-overflow-scrolling: touch;         /* ← smooth scrolling on iOS */
}

.hidden {
  display: none !important;
}

/* ————— Card Container ————— */
.card {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  max-width: 350px;
  background-color: var(--card-color);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* ————— Headings & Text ————— */
h1,h2,h3 {
  margin: 0 0 16px;
  text-align: center;
}
h1 { font-size: 28px; }
h3 { font-size: 20px; }

.intro-text {
  color: var(--secondary-text-color);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 16px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
}

.feature-item .icon {
  flex-shrink: 0;
  font-size: 20px;
  margin-right: 8px;
  line-height: 1.2;
}

.feature-text {
  font-size: 16px;
  line-height: 1.4;
  color: var(--primary-text-color);
}

.feature-text strong {
  font-weight: 600;
  color: var(--primary-text-color);
}

/* ————— Buttons ————— */
.primary-btn {
  display: block;
  width: 90%;
  max-width: 300px;
  margin: 24px auto 0;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: var(--accent-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.primary-btn:hover {
  background-color: var(--accent-hover);
}

.dashboard-btn {
  background-color: #374151 !important;
  margin-top: 12px !important;
}
.dashboard-btn:hover {
  background-color: #4b5563 !important;
}

/* ————— Links ————— */
.alt-link {
  display: block;
  margin: 12px auto 0;
  font-size: 14px;
  text-align: center;
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s;
}
.alt-link:hover {
  text-decoration: underline;
}

/* ————— Inputs ————— */
.input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
}
.input-group .helper-text {
  display: block;
  font-size: 14px;
  color: var(--secondary-text-color);
  margin-bottom: 8px;
}
.input-group input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background-color: var(--input-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--primary-text-color);
}

/* ————— File-upload controls ————— */
.file-upload-group {
  margin-bottom: 16px;
}
.file-upload-label {
  display: block;
  width: 90%;
  max-width: 300px;
  margin: 0 auto;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  color: #fff;
  background-color: var(--accent-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}
.file-upload-label:hover {
  background-color: var(--accent-hover);
}
.file-upload-label.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.hidden-file-input {
  display: none;
}

/* ————— Status & Results ————— */
#result-area,
#photo-status-area {
  margin-top: 24px;
  text-align: center;
  min-height: 20px;
  word-wrap: break-word;
}

/* ————— Photo Preview ————— */
#preview-area {
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 0;
}
#image-preview {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

/* ————— Photo-Intro Screen ————— */
.status-text {
  font-size: 0.95rem;
  color: var(--secondary-text-color);
  text-align: center;
  margin-bottom: 8px;
}

.loading-line {
  position: relative;
  width: 100%;
  height: 4px;
  background-color: var(--accent-color);
  margin-bottom: 16px;
  border-radius: 2px;
  overflow: hidden;
}
.loading-line::before {
  content: '';
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  background-color: rgba(255,255,255,0.6);
  animation: slide 1.2s infinite;
}
@keyframes slide {
  from { left: -40%; }
  to   { left: 100%; }
}

.photo-tips {
  text-align: left;
  padding-left: 20px;
  margin-bottom: 24px;
}
.photo-tips li {
  margin-bottom: 8px;
}
.photo-tips strong {
  font-weight: 600;
}

/* ————— Override: Shorten Intro Card ————— */
#intro-screen .card {
  /* tighten padding */
  padding: 24px;

  /* pin between safe-area top and 16px from bottom */
  top: env(safe-area-inset-top, 0px);
  bottom: 8px;
  max-height: calc(
    100vh
    - env(safe-area-inset-top, 0px)
    - env(safe-area-inset-bottom, 0px)
    - 24px
  );
  overflow-y: auto;
}

/* slightly tighter intro‐text for more room */
#intro-screen .intro-text {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.4;
}

/* pull in feature items a bit */
#intro-screen .feature-item {
  margin-bottom: 12px;
}

/* ————— Final Report Screen Styles ————— */
#create-magic-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

#create-magic-btn:active {
  transform: translateY(0);
}

#create-magic-btn.processing {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: not-allowed;
}

#create-magic-btn.processing::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% {
    left: 100%;
  }
}

/* ————— House Drawing Animation ————— */
/* Base animation for all elements */
@keyframes drawLineLoop {
  0%, 15% {
    stroke-dashoffset: 300;
  }
  30%, 85% {
    stroke-dashoffset: 0;
  }
  95%, 100% {
    stroke-dashoffset: 300;
  }
}

/* Apply looping animation to all elements */
.house-group path,
.house-group rect {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: drawLineLoop 10s ease-in-out infinite;
}

/* ————— My Reports Screen Styles ————— */
/* Report card hover effect */
.report-card {
  transition: all 0.2s ease;
}

.report-card:hover {
  background-color: #333333 !important;
  transform: translateX(4px);
}

/* Search input focus */
#reports-search:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* Bottom navigation buttons */
#my-reports-screen button[onclick] {
  transition: all 0.2s ease;
}

#my-reports-screen button[onclick]:hover {
  transform: translateY(-2px);
  color: var(--accent-color) !important;
}

/* Loading animation for reports */
@keyframes gentlePulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

#reports-loading svg {
  animation: gentlePulse 2s ease-in-out infinite;
}

/* Report status badges */
.report-card span {
  font-weight: 500;
  letter-spacing: 0.025em;
}

/* Scrollbar styling for reports list */
#reports-list::-webkit-scrollbar {
  width: 6px;
}

#reports-list::-webkit-scrollbar-track {
  background: var(--input-background);
  border-radius: 3px;
}

#reports-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

#reports-list::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-text-color);
}

/* ————— NEW: Photo Upload Enhancement Styles ————— */

/* Photo list container */
#photo-list-container {
  margin-top: 20px;
  max-height: 250px;
  overflow-y: auto;
  border-radius: 8px;
  padding: 4px;
}

/* Custom scrollbar for photo list */
#photo-list-container::-webkit-scrollbar {
  width: 6px;
}

#photo-list-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

#photo-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

#photo-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Continue button styling */
#continue-to-analysis {
  width: 90%;
  max-width: 300px;
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

#continue-to-analysis:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

#continue-to-analysis:active {
  transform: translateY(0);
}

/* Photo item animations */
.photo-item {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Status messages */
#upload-status-messages > div {
  animation: fadeIn 0.3s ease;
}

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

/* Edit and Delete button hover states */
.edit-btn, .delete-btn {
  transition: all 0.2s ease;
}

.edit-btn:hover,
.delete-btn:hover {
  transform: scale(1.05);
}

/* Photo item hover state */
.photo-item {
  cursor: default;
  user-select: none;
}

/* Empty state for photo list */
#photo-list-container p {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}
/* ============================================
   Agent/Realtor Notes Section
   Added for seller info input
   ============================================ */
.agent-notes-container {
  margin-top: 20px;
  border-radius: 12px;
  overflow: hidden;
}

.agent-notes-toggle {
  width: 100%;
  padding: 14px 18px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.4);
  border-radius: 12px;
  color: #93c5fd;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.2s ease;
}

.agent-notes-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.6);
}

.agent-notes-toggle .toggle-icon {
  transition: transform 0.2s ease;
  font-size: 12px;
}

.agent-notes-toggle.expanded .toggle-icon {
  transform: rotate(90deg);
}

.agent-notes-content {
  margin-top: 12px;
  padding: 16px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 12px;
}

.agent-notes-content.hidden {
  display: none;
}

.agent-notes-help {
  margin-bottom: 14px;
}

.agent-notes-help .help-title {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.agent-notes-help .help-text {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 10px;
}

.agent-notes-help .help-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.agent-notes-help .help-list li {
  color: #94a3b8;
  font-size: 12px;
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.agent-notes-help .help-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #3b82f6;
}

.agent-notes-help .help-list li strong {
  color: #cbd5e1;
}

.agent-notes-textarea {
  width: 100%;
  padding: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  box-sizing: border-box;
}

.agent-notes-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.agent-notes-textarea::placeholder {
  color: #64748b;
  font-size: 12px;
}

.notes-privacy {
  color: #64748b;
  font-size: 11px;
  margin-top: 8px;
  text-align: center;
}
