/* 
   CSS Variables (Color Tokens) to be inherited throut the entire system
 */
 /* Scale fix: Make 100% zoom look like 80% zoom */
html {
  zoom: 0.8;
}
 :root {
  /* Light theme variables (default) */
  --primary-color: #005f73;       /* Deep teal */
  --secondary-color: #0a9396;     /* Lighter teal */
  --accent-color: #94d2bd;        /* Soft accent */
  --bg-color: #f1faee;            /* Overall page background */
  --form-bg: #ffffff;             /* Background for forms, cards, etc. */
  --text-color: #333;             /* General text color */
  --border-color: #e0e0e0;         /* Borders for cards, forms, tables */
  --error-color: #d32f2f;          /* Error messages */
  --button-hover: #004e66;        /* Hover state for buttons */
}

/* Dark mode: Applied only if the html element has the .dark-mode class */
html.dark-mode {
  --primary-color: #00c2ff;    /* Ultra-premium electric cyan (bold, high-end) */
  --secondary-color:#d35400;  /* Deep rare magenta (luxurious contrast) */
  --accent-color: #00ffcc;     /* Sleek neon turquoise (futuristic highlights) */
  --bg-color: #050505;         /* True BLACK HOLE black (OLED perfect) */
  --form-bg: #101010;          /* Darkened obsidian gray (matte smoothness) */
  --text-color: #f5f5f5;       /* Ultra-premium diamond white (soft, expensive readability) */
  --border-color: #1a1a1a;     /* Rich, subtle borders (clean & modern) */
  --button-hover: #00eaff;     /* Glowing crystal blue (powerful & dynamic) */
  --shadow-color: rgba(0, 255, 255, 0.25); /* Deep, rich ambient neon glow */
  --glass-bg: rgba(255, 255, 255, 0.05);  /* Sleek glassmorphism effect */
  --golden-accent: #ffcc00;    /* Subtle luxury gold accent (for premium touch) */
}

html.dark-mode .insights-explanation {
  background-color: var(--form-bg); /* Dark obsidian gray for uniformity */
  color: var(--text-color); /* Matches insight-description color */
  
  font-size: 1.07rem;
  padding: 19px;
  border-radius: 8px;
  box-shadow: -6px 6px 15px rgba(0, 255, 127, 0.4), /* Green glow on left */
              0 4px 10px var(--shadow-color); /* Subtle ambient glow */
  position: relative; /* Needed for extra effects */
}



/* (Optional) You can also add a .light-mode class for clarity */
html.light-mode {
  /* Same as the default :root values */
  --primary-color: #005f73;
  --secondary-color: #0a9396;
  --accent-color: #94d2bd;
  --bg-color: #f1faee;
  --form-bg: #ffffff;
  --text-color: #333;
  --border-color: #e0e0e0;
  --error-color: #d32f2f;
  --button-hover: #004e66;
}
/* 
   Light Mode - Insights Box Glow Effect    
    Soft minty ambient glow to enhance visibility on a white background.  
*/
html.light-mode .insights-explanation {
  background-color: var(--bg-color); /* Keep light mode background */
  padding: 15px;
  border-radius: 8px;
  box-shadow: -6px 6px 20px rgba(10, 147, 150, 0.6), /* Teal glow on left */
              0 6px 15px rgba(148, 210, 189, 0.7);  /* Minty soft ambient glow */
  position: relative;
  color: var(--text-color); /* Ensures readability */
}



/* ============================================
   Global Reset and Body
============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding: 20px;
  overflow-x: hidden;
}

/* ============================================
   Header with Geometric Overlay & Radial Gradient
============================================ */
header {
  position: relative;
  text-align: center;
  margin-bottom: 30px;
  padding: 40px 20px;
  background: radial-gradient(circle at top left, var(--primary-color), var(--secondary-color));
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  color: #fff;
  overflow: hidden;
}

/* Theme toggle button in header */
#theme-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 1.5rem;
  z-index: 2;
  background: transparent;
  border: none;
}

/* Ensure Font Awesome icons inside the toggle have the desired size */
#theme-toggle i {
  font-size: 1.5rem;
}

/* Enforce icon colors:
   - When in dark mode the sun icon (fa-sun) should be white.
   - When in light mode the moon icon (fa-moon) will be dark.
*/
#theme-toggle i.fa-sun {
  color: #fff !important;
}

#theme-toggle i.fa-moon {
  color: #333 !important;
}

header::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255,255,255,0.3), transparent);
  border-radius: 50%;
  top: -50px;
  right: -50px;
  z-index: 0;
}

header h1,
header p {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

header p {
  font-size: 1.1rem;
}

/* ============================================
   Main Layout
============================================ */
main {
  max-width: 1200px;
  margin: 0 auto;
}
.purpose-selection {
  display: flex;
  justify-content: center; /* Centers it horizontally */
  align-items: center;
  gap: 20px; /* Adds spacing between radio buttons */
  padding: 20px 0;
  margin-top: 30px; /* Adds space above */
  margin-bottom: 30px; /* Adds space below */
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-color);
  background: var(--background-secondary); /* Subtle background */
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.purpose-selection label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: opacity 0.3s ease, color 0.3s ease; /* Smooth fade and color change */
}

.purpose-selection input[type="radio"] {
  accent-color: var(--primary-color); /* Uses primary theme color */
  transform: scale(1.2); /* Makes radio buttons slightly larger */
  cursor: pointer;
  transition: transform 0.2s ease; /* Smooth hover effect */
}

.purpose-selection input[type="radio"]:hover {
  transform: scale(1.3); /* Slightly enlarge on hover */
}

.purpose-selection label:hover {
  color: var(--primary-color); /* Highlight text on hover */
}

/* Selected state */
.purpose-selection label.selected {
  color: var(--primary-color); /* Highlight text when selected */
}

.purpose-selection label.selected input[type="radio"] {
  accent-color: var(--primary-color); /* Highlight radio button when selected */
}



/* ============================================
   Form Section
============================================ */
.tooltip {
  display: inline-block;
  margin-left: 5px;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  cursor: help;
}
#form-section {
  position: relative;
  background: var(--form-bg);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

#form-section form {
  display: grid;
   grid-template-columns: repeat(4, 1fr); /* Force 4 columns instead of auto-fit */
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--text-color);
}

.form-group input {
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  background: var(--form-bg);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px rgba(0,95,115,0.4);
  outline: none;
}

.error-message {
  color: var(--error-color);
  font-size: 0.85rem;
  margin-top: 5px;
  display: none;
}

/* ============================================
   Predict Button
============================================ */
#predict-btn {
  grid-column: 1 / -1;
  padding: 15px;
  background: radial-gradient(circle, var(--primary-color), var(--secondary-color));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s;
}

#predict-btn:disabled {
  background: radial-gradient(circle, #a0c1d1, #8fa9bf);
  cursor: not-allowed;
}

#predict-btn:hover:not(:disabled) {
  background: radial-gradient(circle, var(--button-hover), var(--secondary-color));
}

/* ============================================
   Result Section
============================================ */
#result-section {
  background: var(--form-bg);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  margin-bottom: 30px;
  opacity: 0;
  transform: translateY(-10px);
  animation: slideDown 0.5s forwards;
}

#result-section.hidden {
  display: none;
}

@keyframes slideDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#result-section h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
  font-weight: 700;
}

#prediction-message {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-color);
}



/* ============================================
   Realtor.com Link Container
============================================ */
#realtor-link-container {
  margin-top: 20px;
  text-align: center;
}

#realtor-link-container p {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.5;
}

#realtor-link-container a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

#realtor-link-container a:hover {
  color: var(--button-hover);
  text-decoration: underline;
}

/* ============================================
   Model Insights Cards
============================================ */
/* ===== Model Insights Section ===== */
#insights-container {
  background: var(--form-bg); /* Background for the entire section */
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.insights-title {
  text-align: center;
  font-size: 1.8rem; /* Adjust to match  other headings in the web */
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 1.2rem; /* Adds spacing before the next section */
  border-bottom: 2px solid var(--secondary-color); /* Subtle underline for emphasis */
  padding-bottom: 0.5rem;
}


.insights-text {
  text-align: left;  /* Ensures all text starts from the left */
}
.insights-text p {
  margin-bottom: 4px; /* Adjust for perfect spacing */
  line-height: 1.5;
}

/* Explanation Text */
/* Insights Explanation - Glassmorphism Style */
.insights-explanation {
  background: rgba(255, 255, 255, 0.2); /* Slightly more visible */
  backdrop-filter: blur(8px);
  padding: 20px 28px; /* Increased padding for space */
  border-radius: 12px;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 500; /* Slightly bolder than before */
  color: rgba(0, 0, 0, 0.75); /* Balanced contrast */
  line-height: 1.6; /* More open spacing */
  max-width: 85%; /* Takes up more width for openness */
  margin: 15px auto 30px; /* More breathing room */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
  border-left: 5px solid var(--accent-color); /* Slightly thicker */
  transition: all 0.3s ease-in-out;
}

/* Hover Effect - Gentle Lift */
.insights-explanation:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
/* Container for Images & Text - Unified Look */
.insights-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: var(--form-bg); /* Keeps consistency */
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

/* Style for Each Insight (Image + Text) */
.insight {
  flex: 1;
  min-width: 300px;
  text-align: center;
  padding: 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease-in-out;
}

/* Subtle Scale-Up Effect on Hover */
.insight:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Image Styling */
.insight img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Diagram Description Text - A Bit More Presence */
.diagram-description {
  font-size: 0.95rem; /* Slightly larger */
  margin-top: 10px;
  color: rgba(0, 0, 0, 0.7); /* A little darker for clarity */
  font-weight: 500; /* Subtly bolder */
  opacity: 0.9;
}





/* Insights Wrapper */
.insights-content {
  display: flex;
  justify-content: space-between; /* Keeps images side by side */
  gap: 20px; /* Spacing between images */
  flex-wrap: wrap; /* Ensures responsiveness */
}

/* Individual Insight Boxes */
.insight {
  flex: 1;
  min-width: 280px;
  max-width: 48%; /* Prevents them from stretching too much */
  text-align: center;
  padding: 15px;
  border-radius: 10px;
  background: var(--form-bg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease-in-out;
}

/* Hover Effect */
.insight:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Image Styling */
.insight img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Insight Descriptions */
.insight-description {
  font-size: 0.95rem;
  color: var(--text-color);
  margin-top: 5px;
}




/* ============================================
   Back-to-Form Button
============================================ */
#back-to-form {
  padding: 10px 20px;
  background: radial-gradient(circle, var(--primary-color), var(--secondary-color));
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

#back-to-form:hover {
  background: radial-gradient(circle, var(--button-hover), var(--secondary-color));
}

/* ============================================
   History Section
============================================ */
#history-section {
  background: var(--form-bg);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

#history-section h2 {
  margin-bottom: 15px;
  color: var(--primary-color);
  text-align: center;
  font-weight: 700;
}

#history-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}

#history-table th,
#history-table td {
  padding: 10px;
  border: 1px solid var(--border-color);
  text-align: center;
}

#history-table th {
  background: radial-gradient(circle, var(--primary-color), var(--secondary-color));
  color: #fff;
  font-weight: 600;
}

/* History Toggle Button */
#toggle-history {
  padding: 10px 20px;
  background: radial-gradient(circle, var(--primary-color), var(--secondary-color));
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 1rem;
  margin-right: 10px;
}

#toggle-history:hover {
  background: radial-gradient(circle, var(--button-hover), var(--secondary-color));
}

/* Clear History Button */
#clear-history {
  padding: 10px 20px;
  background: radial-gradient(circle, #d32f2f, #c62828);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

#clear-history:hover {
  background: radial-gradient(circle, #b71c1c, #a91a1a);
}

.admin-container {
  max-width: 1200px;
  margin: 20px auto;
  background: var(--form-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.admin-container h1 {
  text-align: center;
  color: var(--primary-color);
}









/* 
   Compact & Elegant Footer
    */
  
/* Footer Styling */
footer {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 2px solid var(--golden-accent);
  box-shadow: 0 -3px 15px rgba(255, 204, 0, 0.1);
  padding: 18px 0;
  color: var(--text-color);
  font-size: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Footer Container */
.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  gap: 1rem; /* Adjusted for a smaller gap between elements */
  margin: 0 auto;
  padding: 0 1rem; /* Padding on sides */
}

/* Footer Branding */
.footer-logo p {
  font-size: 1rem;
  font-weight: normal;
  color: var(--text-color);
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1;
}

/* Navigation Links */
.footer-links {
  display: flex;
  gap: 10px; /* Slightly smaller gap between buttons */
}

/* Main Button Links */
.main-link {
  padding: 6px 16px;
  background: var(--primary-color);
  color: white;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.main-link:hover {
  background: var(--button-hover);
  transform: translateY(-3px);
}

/* Developer Credit */
.developer-credit {
  font-size: 1rem;
}

.dev-link {
  color: var(--text-color);
  font-size: 1rem;
  font-weight: normal;
  text-decoration: none;
  transition: color 0.3s ease;
}

.dev-link:hover {
  color: var(--primary-color);
}

/* Dark Mode Enhancements */
html.dark-mode footer {
  background: rgba(0, 0, 0, 0.5);
  border-top: 2px solid #d35400;
  box-shadow: 0 -3px 15px #d35400; /* Darker shadow for contrast */
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Stack elements vertically on smaller screens */
  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
  }

  .footer-links {
    margin-top: 1rem;
    justify-content: center;
    gap: 10px;
  }

  .footer-logo p {
    font-size: 0.9rem; /* Slightly smaller text */
  }

  .main-link {
    padding: 6px 12px; /* Adjust padding for smaller screens */
  }

  .dev-link {
    font-size: 0.9rem;
  }
}




/* === Table Dark Mode Fix === */
/* This section overrides all other table styles to ensure visibility in dark mode */

/* Default table styling */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px;
  border: 1px solid #ddd;
}

/* Alternate row coloring */
tr:nth-child(even) { 
  background-color: #f2f2f2; /* Light gray for normal mode */
}

tr:nth-child(odd) { 
  background-color: #ffffff; /* White for normal mode */
}

/* Dark mode styles */
.dark-mode tr:nth-child(even) { 
  background-color: #333333; /* Dark gray for visibility */
}

.dark-mode tr:nth-child(odd) { 
  background-color: #444444; /* Slightly lighter dark gray */
}

.dark-mode th, .dark-mode td {
  color: #ffffff; /* White text for better visibility */
  border-color: #555555; /* Darker border for contrast */
}
/* === End of Table Dark Mode Fix === */

