/* ===== J. Clarke Realty — Custom Styles ===== */

/* Global font family */
body, .mud-typography {
    font-family: 'Inter', 'Helvetica', 'Arial', sans-serif !important;
}

/* Prevent horizontal scrollbar from elements overflowing viewport */
body {
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    background: var(--brand-primary);
    color: white;
    padding: 4rem 0;
    margin-bottom: 0;
}

.hero-title {
    color: white !important;
    font-weight: 700;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 400;
}

.hero-search-bar {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    margin: 0 auto;
}

/* Listing Cards */
.listing-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    overflow: hidden;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Trust / Stats Section */
.trust-section {
    background-color: #f5f9f7;
}

/* CTA Cards */
.cta-card {
    border-radius: 12px;
    border-left: 4px solid;
    border-color: var(--mud-palette-primary);
    transition: box-shadow 0.2s ease;
}

.cta-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Stat Chips on Listing Detail */
.stat-chip {
    background-color: #f5f9f7;
    border-radius: 8px;
}

/* Sticky Sidebar on Listing Detail */
.sticky-sidebar {
    position: sticky;
    top: 80px;
    border-radius: 12px;
}

/* Save Search CTA */
.save-search-cta {
    border-radius: 12px;
    background: #f5f9f7;
}

/* Home Valuation Hero */
.valuation-hero {
    background: #f5f9f7;
}

/* Footer */
.site-footer {
    background-color: #1a1a1a;
    color: rgba(255, 255, 255, 0.9);
    padding-top: 3rem;
    margin-top: 3rem;
}

.footer-heading {
    color: white !important;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7) !important;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: white !important;
}

/* Mobile Sticky Bottom Bar */
.mobile-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

/* Add padding to body so content isn't hidden behind sticky bar on mobile */
@media (max-width: 1279px) {
    .mud-main-content {
        padding-bottom: 56px;
    }
}

/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Font weight utility */
.fw-bold {
    font-weight: 600 !important;
}

/* Gap utility (MudBlazor may not have this) */
.gap-1 {
    gap: 4px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better focus outlines for accessibility */
*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Blog content rendered from Markdown */
.blog-content h1 { font-size: 1.8rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.blog-content h2 { font-size: 1.5rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.blog-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.2rem 0 0.4rem; }
.blog-content p { margin: 0 0 1rem; line-height: 1.7; }
.blog-content ul, .blog-content ol { margin: 0 0 1rem 1.5rem; }
.blog-content li { margin-bottom: 0.3rem; line-height: 1.6; }
.blog-content blockquote {
    border-left: 4px solid var(--brand-primary);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: #f5f9f7;
    border-radius: 0 8px 8px 0;
}
.blog-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }
.blog-content a { color: var(--brand-primary); text-decoration: underline; }
.blog-content code {
    background: #f0f0f0;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}
.blog-content pre {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}
.blog-content pre code {
    background: none;
    padding: 0;
}
.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.blog-content th, .blog-content td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.blog-content th { background: #f5f5f5; font-weight: 600; }

/* Gap utility */
.gap-2 {
    gap: 8px;
}

/* Leaflet map price markers */
.leaflet-price-marker {
    background: none;
    border: none;
}
.price-tag {
    background: var(--brand-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    text-align: center;
}
.price-tag::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--brand-primary);
}
.map-popup {
    min-width: 200px;
}
.map-popup img {
    display: block;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    padding: 0 !important;
    overflow: hidden;
}
.leaflet-popup-content {
    margin: 0 !important;
}

/* Neighborhood radius overlay labels */
.neighborhood-label {
    background: none;
    border: none;
}
.neighborhood-tag {
    background: rgba(26, 86, 50, 0.85);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Share buttons */
.share-buttons {
    flex-wrap: wrap;
}

/* Footer social icons */
.footer-social-icon {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: color 0.2s, transform 0.2s;
}
.footer-social-icon:hover {
    color: white !important;
    transform: scale(1.15);
}

/* Footer newsletter input — ensure visibility on dark footer background */
.footer-input .mud-input-slot,
.footer-input input.mud-input-slot {
    color: white !important;
    -webkit-text-fill-color: white !important;
    background-color: transparent !important;
}
.footer-input .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.4) !important;
}
.footer-input:hover .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.7) !important;
}
.footer-input .mud-input-adornment-end .mud-icon-button {
    color: #2ecc71 !important;
}
.footer-input input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.5) !important;
}
/* Override MudBlazor's inner input wrapper background */
.footer-input .mud-input.mud-input-outlined {
    background-color: transparent !important;
}
.footer-input .mud-input-control {
    background-color: transparent !important;
}

/* MudBlazor textarea/input contrast fix — prevents browser dark mode
   from setting dark backgrounds while MudBlazor keeps light text colors */
.mud-input-outlined .mud-input-slot,
.mud-input-outlined textarea.mud-input-slot {
    color: var(--mud-palette-text-primary) !important;
    background-color: var(--mud-palette-surface) !important;
    -webkit-text-fill-color: var(--mud-palette-text-primary) !important;
}
.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--mud-palette-lines-inputs) !important;
}
/* Ensure MudSelect dropdowns also have proper contrast */
.mud-select-input {
    color: var(--mud-palette-text-primary) !important;
}

/* Blog content dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .blog-content blockquote {
        background: #1e2a22;
        border-left-color: #2ecc71;
    }
    .blog-content th {
        background: #2a2a2a;
    }
}

/* MudBlazor 9.x — fix duplicate labels on ALL outlined inputs site-wide */
.mud-input-label-outlined {
    transform: translate(14px, -9px) scale(0.75) !important;
    transform-origin: top left !important;
    top: 0 !important;
}
.mud-input-outlined .mud-input-outlined-border legend {
    max-width: 100% !important;
}

/* Native HTML selects — styled to match site theme */
.select-label {
    display: block !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #555 !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
}
.site-select {
    display: block !important;
    width: 100% !important;
    padding: 12px 36px 12px 14px !important;
    font-size: 0.95rem !important;
    font-family: 'Inter', 'Helvetica', 'Arial', sans-serif !important;
    border: 2px solid #ccc !important;
    border-radius: 8px !important;
    background-color: white !important;
    color: #1a1a1a !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    cursor: pointer !important;
    transition: border-color 0.2s !important;
    box-sizing: border-box !important;
    height: auto !important;
    line-height: 1.4 !important;
}
.site-select:focus {
    outline: none !important;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(26, 86, 50, 0.15) !important;
}
.site-select:hover {
    border-color: var(--brand-primary) !important;
}

/* Dark mode support for native selects */
@media (prefers-color-scheme: dark) {
    .select-label { color: #aaa !important; }
    .site-select {
        background-color: #1e1e1e !important;
        color: #e0e0e0 !important;
        border-color: #555 !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") !important;
    }
    .site-select:focus { border-color: #2ecc71 !important; box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15) !important; }
}

/* Carousel — larger, more visible prev/next arrows */
.photo-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(26, 86, 50, 0.85);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    z-index: 10;
}
.photo-nav-btn:hover {
    background: rgba(26, 86, 50, 1);
    transform: translateY(-50%) scale(1.08);
}
.photo-nav-btn .mud-icon-root {
    font-size: 2rem !important;
    color: white !important;
}

/* Print styles — hide nav and footer */
@media print {
    .mud-appbar,
    .mud-drawer,
    .mobile-sticky-bar,
    .site-footer {
        display: none !important;
    }
}

/* Fullscreen Photo Gallery Overlay */
.gallery-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fs-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 8px 12px;
    z-index: 10000;
    transition: color 0.2s;
}

.fs-btn:hover {
    color: white;
}
