/* -------------------------------------------------------------------------
   HOMENDO CORE STYLES v16.2 (Dark Mode Certified)
   -------------------------------------------------------------------------
   Location: /a_assets/css/style.css
   Author: Homendo Dev Team (AI Assisted)
   Date: 2025-Nov-26
   Stack: Bootstrap 5.3+ Override / Modern CSS
   ------------------------------------------------------------------------- */

/* ==========================================================================
   1. VARIABLES & DESIGN TOKENS
   ========================================================================== */
:root {
    /* Brand Colors (Light Mode Default) */
    --hmdo-blue: #073855;       /* Deep Navy */
    --hmdo-light-blue: #1396e2; /* Links */
    --hmdo-gold: #FFCC33;       /* Actions */
    --hmdo-gold-hover: #e6b800;
    --hmdo-magenta: #d51b73;    /* TimeToSell */
    --hmdo-magenta-dark: #b21560;
    
    /* Neutrals */
    --hmdo-gray-100: #f8f9fa;
    --hmdo-text-body: #4a4a4a;

    /* UI */
    --hmdo-radius: 8px;
    --hmdo-shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --hmdo-font-sans: 'Open Sans', sans-serif;

    /* Components (Light Mode) */
    --hmdo-glass-bg: rgba(255, 255, 255, 0.95);
    --hmdo-glass-border: rgba(0,0,0,0.05);
    --hmdo-sidebar-active-bg: #ebf5ff;
    --hmdo-sidebar-active-text: #0d6efd;
    --hmdo-sidebar-active-border: #dee2e6;
}

/* DARK MODE OVERRIDES */
[data-bs-theme="dark"] {
    /* Adjusted Brand Colors for Contrast */
    --hmdo-blue: #6ea8fe;        /* Lighter blue for readability on dark */
    --hmdo-light-blue: #3dd5f3;  /* Cyan for links */
    --hmdo-text-body: #dee2e6;   /* Light grey text */
    --hmdo-gray-100: #2b3035;    /* Dark grey background */
    --hmdo-shadow-lg: 0 10px 25px rgba(0,0,0,0.5); 

    /* Components (Dark Mode) */
    --hmdo-glass-bg: rgba(33, 37, 41, 0.95); /* Dark grey glass */
    --hmdo-glass-border: rgba(255,255,255,0.1);
    --hmdo-sidebar-active-bg: #023770;       /* Dark blue background */
    --hmdo-sidebar-active-text: #28acd8;     /* Light blue text */
    --hmdo-sidebar-active-border: #0195b8;
}

/* ==========================================================================
   2. GLOBAL & TYPOGRAPHY
   ========================================================================== */
html {
    height: 100%;
}

body {
    font-family: var(--hmdo-font-sans);
    color: var(--bs-body-color);      
    background-color: var(--bs-body-bg); /* Critical for Dark Mode No-Flash */
    line-height: 1.6;
    min-height: 100%;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--hmdo-blue); /* Uses variable for auto-switching */
    font-weight: 700;
}

a {
    color: var(--hmdo-light-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--hmdo-blue); }

/* ==========================================================================
   3. NAVIGATION
   ========================================================================== */
.navigation-wrapper {
    background: var(--bs-body-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1030;
}

.navbar-brand img { transition: transform 0.3s ease; }
.navbar-brand:hover img { transform: scale(1.02); }

/* Modern "AI Blue" (Electric Cyan) with Glow */
[data-bs-theme="dark"] .navbar-brand img {
    /* 1. Turn White -> 2. Sepia Base -> 3. Saturate -> 4. Rotate to Cyan -> 5. Add Glow */
    filter: brightness(0) invert(1) sepia(1) saturate(500%) hue-rotate(180deg) brightness(1.1) drop-shadow(0 0 4px rgba(61, 213, 243, 0.4));
}

.nav-link {
    color: var(--bs-body-color) !important; /* Use BS variable for adaptability */
    font-weight: 600;
    padding: 0.5rem 1rem !important;
}
.nav-link:hover, .nav-link.active { color: var(--hmdo-light-blue) !important; }

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--hmdo-glass-border);
    box-shadow: var(--hmdo-shadow-lg);
    border-radius: var(--hmdo-radius);
    margin-top: 10px;
    background-color: var(--hmdo-glass-bg) !important; /* Glassmorphism */
    backdrop-filter: blur(10px);           
    -webkit-backdrop-filter: blur(10px);   
}

.dropdown-item { 
    padding: 8px 20px; 
    font-size: 0.95rem; 
    color: var(--bs-body-color);
}

.dropdown-item:hover { 
    background-color: var(--bs-tertiary-bg); 
    color: var(--hmdo-light-blue); 
}

/* ==========================================================================
   4. HERO CAROUSEL
   ========================================================================== */
#homeCarousel { background-color: #000; }

.slide-hero {
    height: 65vh;
    min-height: 500px;
    max-height: 780px;
    object-fit: cover;
    object-position: center;
    opacity: 0.9; 
    filter: brightness(0.9) contrast(1.1); 
}

@media (max-width: 768px) {
    .slide-hero { height: 50vh; min-height: 300px; }
}

.hero-overlay {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

/* Fix text readability over hero images */
.hero-text-container { z-index: 10; position: relative; }

/* ==========================================================================
   5. SEARCH BOX & FILTERS
   ========================================================================== */
.search-box-wrapper {
    position: relative;
    margin-top: -120px;
    z-index: 100;
    padding-bottom: 40px;
}

.search-box {
    background: var(--hmdo-glass-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--hmdo-radius);
    box-shadow: var(--hmdo-shadow-lg);
    border: 1px solid var(--hmdo-glass-border);
}

.nav-pills .nav-link {
    color: var(--hmdo-blue);
    border-radius: 50px;
    padding: 8px 25px;
    font-weight: 700;
    margin-right: 10px;
}
/* In Dark Mode, make non-active pills lighter so they are visible */
[data-bs-theme="dark"] .nav-pills .nav-link:not(.active) {
    color: var(--bs-body-color);
}

.nav-pills .nav-link.active { background-color: var(--hmdo-blue); color: #fff; }

.form-select, .form-control {
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 0.95rem;
    /* BS5 handles background/text color automatically */
}
.form-select:focus, .form-control:focus {
    border-color: var(--hmdo-light-blue);
    box-shadow: 0 0 0 0.25rem rgba(19, 150, 226, 0.25);
}

/* Sidebar Accordion Styling */
#search-filters-form .accordion-item {
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 0.25rem !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
    background-color: var(--bs-body-bg);
}

#search-filters-form .accordion-button {
    background-color: var(--bs-tertiary-bg); /* Adapts to theme */
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    color: var(--bs-body-color);
    box-shadow: none !important;
}

#search-filters-form .accordion-button:not(.collapsed) {
    background-color: var(--bs-body-bg);
    color: var(--hmdo-blue);
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

/* Active Filter Indicator (Theme Aware) */
.accordion-button.has-active-filter {
    background-color: var(--hmdo-sidebar-active-bg) !important; 
    color: var(--hmdo-sidebar-active-text) !important; 
    font-weight: 800;
    border: 1px solid var(--hmdo-sidebar-active-border) !important;
}

/* ==========================================================================
   6. UI ELEMENTS
   ========================================================================== */
.btn-hmdo {
  /* --- Layout & Text --- */
  padding: 4px 6px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #e0faff; /* Whitish-cyan text for readability */
  cursor: pointer;
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;

  /* --- The "Tech Circuit" Background --- */
  background-color: #023770;

  /* This creates the grid/schematic lines using pure CSS */
  background-image: 
    linear-gradient(rgba(0, 243, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 243, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px; /* Size of the grid squares */

  /* --- Border & Glow --- */
  border: 1px solid rgba(0, 243, 255, 0.5); /* Semi-transparent cyan border */
  box-shadow: 0 0 10px rgba(0, 18, 51, 0.8); /* Dark shadow to lift it off the page */
}

/* --- Hover State: Activates the "Circuit" --- */
.btn-hmdo:hover {
  /* Text becomes the bright House Orange */
  color: #f9c409; 
  border-color: #ffb300;

  /* Background gets slightly lighter to show interactivity */
  background-color: #051540;

  /* The grid lines glow orange on hover */
  background-image: 
    linear-gradient(rgba(255, 179, 0, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 179, 0, 0.15) 1px, transparent 1px);

  box-shadow: 0 0 15px rgba(255, 179, 0, 0.3); /* Soft orange glow */
}

/* --- Active State (Clicking) --- */
.btn-hmdo:active {
  transform: scale(0.98); /* Button presses down */
}

[data-bs-theme="dark"] {
    .btn-hmdo {
      /* --- Layout & Text --- */
      padding: 4px 6px;
      font-size: 15px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
      cursor: pointer;
      border-radius: 4px;
      position: relative;
      transition: all 0.3s ease;

      /* --- The "Stealth" Look --- */
      color: #8daec4; /* Muted steel-blue text (not bright white) */
      background-color: #023770;
      border: 1px solid rgba(141, 174, 196, 0.2); /* Dim, subtle border */

      /* --- Faint Grid (Barely visible until hover) --- */
      background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
      background-size: 20px 20px;

      /* No box-shadow by default to keep it "recessed" */
      box-shadow: none; 
    }

    /* --- Hover State: Wakes up the System --- */
    .btn-hmdo:hover {
      /* Text turns to the bright Neon Cyan (The 'Home' color) */
      color: #00f3ff; 
      border-color: #00f3ff;

      /* Background gets slightly richer */
      background-color: #00152e;

      /* The grid lines glow Cyan on hover */
      background-image: 
        linear-gradient(rgba(0, 243, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.1) 1px, transparent 1px);

      /* Cool Cyan Glow (Distinct from the Main Button's Orange) */
      box-shadow: 0 0 12px rgba(0, 243, 255, 0.25);
    }

    /* --- Active State --- */
    .btn-hmdo:active {
      transform: scale(0.98);
    }
}



.btn-search-action {
    background-color: var(--hmdo-gold);
    color: #000; /* Force black text on Gold for contrast */
    font-weight: 800;
    border: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
    padding: 10px 20px;
}
.btn-search-action:hover {
    background-color: var(--hmdo-gold-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 204, 51, 0.4);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--hmdo-shadow-lg) !important;
    transition: transform 0.2s ease;
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
#page-footer {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color);
    font-size: 0.9rem;
    border-top: 1px solid var(--bs-border-color) !important;
}
#page-footer h5 { font-size: 1rem; font-weight: 800; color: var(--hmdo-blue); }
#page-footer a { color: var(--bs-body-color); }
#page-footer a:hover { color: var(--hmdo-light-blue); text-decoration: none; }

/* ==========================================================================
   8. MODERN OMNIBAR SEARCH
   ========================================================================== */
.omnibar-container { position: relative; z-index: 10; }

.omnibar-switcher .nav-link {
    background: rgba(0,0,0,0.4); 
    color: #fff; 
    border: 1px solid rgba(255,255,255,0.3);
    margin: 0 5px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
.omnibar-switcher .nav-link.active {
    background: var(--bs-body-bg); 
    color: var(--hmdo-blue); 
    border-color: var(--bs-border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.omnibar-field label { font-size: 0.7rem; letter-spacing: 0.5px; }

.btn-search-pill {
    background: linear-gradient(135deg, var(--hmdo-magenta) 0%, #b21560 100%);
    border: none;
    transition: transform 0.2s;
    color: white;
}
.btn-search-pill:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(213, 27, 115, 0.4);
}

/* ==========================================================================
   9. MEGA MENU & UTILITIES
   ========================================================================== */
@media (min-width: 1200px) {
    .navbar-nav .nav-item.has-megamenu { position: static; }

    .dropdown-menu.megamenu {
        position: absolute;
        top: 90%; 
        left: 0;
        right: 0;
        width: 100%;
        margin-top: 0;
        border-radius: 0 0 8px 8px;
        border-top: 1px solid var(--bs-border-color);
        background-color: var(--bs-body-bg);
    }
    
    .dropdown-hover:hover > .dropdown-menu {
        display: block;
        margin-top: 0; 
    }
}

/* Text Utilities for Contrast */
.text-primary { color: var(--hmdo-blue) !important; }
.text-gold { color: var(--hmdo-gold) !important; }
.bg-gold { background-color: var(--hmdo-gold) !important; }

.text-shadow-sm { text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.text-shadow-lg { text-shadow: 0 2px 4px rgba(0,0,0,0.7); }