/* ============================================================================
   REAL ESTATE SYSTEM - MODERN BEAUTIFUL STYLESHEET
   ============================================================================ */

/* NOTE: ALL theme CSS variables (--primary-color, --secondary-color,
   --success-color, --danger-color, --warning-color, --info-color,
   --navbar-bg, --footer-bg) are injected dynamically by main.php
   from the theme_settings DB table. Do NOT redefine them here or
   admin theme changes will be silently overridden. */

:root {
    /* Static layout/structural variables only — not theme colors */
    --light-color:  #f8f9fa;
    --dark-color:   #343a40;
    --text-color:   #333;
    --text-muted:   #6c757d;
    --border-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #fff;
}

/* ============================================================================
   NAVBAR STYLES
   ============================================================================ */

.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar-brand span.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color) !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    border-bottom: 2px solid var(--primary-color);
}

/* ============================================================================
   HERO BANNER SECTION
   ============================================================================ */

.hero-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 70px 0 60px;
    color: white;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 380px;
    height: 380px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: 10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* Trust pill */
.hero-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #a8d8b0;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 20px;
}

.hero-trust-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4caf82;
    flex-shrink: 0;
}

/* Title */
.hero-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 3;
}

.hero-title-accent {
    background: linear-gradient(90deg, #f9c74f, #f4845f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtitle */
.hero-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 480px;
    position: relative;
    z-index: 3;
}

/* Search card */
.hero-search-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    margin-bottom: 28px;
    position: relative;
    z-index: 3;
}

/* Tabs */
.hero-search-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.hstab {
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px !important;
    cursor: pointer;
    color: #666 !important;
    background: transparent !important;
    border: 1px solid #ddd !important;
    transition: all 0.2s;
    line-height: 1.5;
}

.hstab.active {
    background: var(--secondary-color) !important;
    color: #fff !important;
    border-color: var(--secondary-color) !important;
}

.hstab:hover:not(.active) {
    background: #f0f0f0 !important;
    border-color: #ccc !important;
}

/* Search row */
.hero-search-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.hsf-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.hsf-group input,
.hsf-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Poppins', sans-serif;
}

.hsf-group input:focus,
.hsf-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.btn-hero-search {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s, transform 0.2s;
    font-family: 'Poppins', sans-serif;
}

.btn-hero-search:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Stats bar */
.hero-stats-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 3;
    flex-wrap: wrap;
}

.hstat {
    display: flex;
    flex-direction: column;
}

.hstat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.hstat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 3px;
}

.hstat-sep {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* Right panel */
.hero-listings-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 3;
}

.hero-listings-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(249, 199, 79, 0.15);
    border: 1px solid rgba(249, 199, 79, 0.3);
    color: #f9c74f;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    align-self: flex-start;
    margin-bottom: 4px;
}

.hero-prop-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    text-decoration: none !important;
    color: #fff !important;
    transition: background 0.2s;
}

.hero-prop-card:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
    text-decoration: none !important;
}

.hero-prop-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgba(255,255,255,0.7);
    overflow: hidden;
}

.hero-prop-info {
    flex: 1;
    min-width: 0;
}

.hero-prop-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-prop-loc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-prop-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.hero-prop-meta span {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.hero-prop-meta i {
    font-size: 9px;
}

.hero-prop-price {
    font-size: 13px;
    font-weight: 700;
    color: #f9c74f;
    flex-shrink: 0;
    white-space: nowrap;
}

.hero-prop-empty {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    padding: 24px 16px;
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: 12px;
}

.hero-prop-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.hero-view-all {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45) !important;
    text-decoration: none !important;
    padding-top: 4px;
    transition: color 0.2s;
    display: block;
}

.hero-view-all:hover {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* ============================================================================
   FEATURED PROPERTIES SECTION
   ============================================================================ */

section {
    padding: 60px 0;
}

section h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

section .lead {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.property-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.property-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.property-card .card-img-top {
    height: 280px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.property-card .badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--warning-color);
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
}

.property-card .card-body {
    padding: 1.5rem;
}

.property-card .card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.property-card .card-address {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.property-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Property card meta chips (city / bed / bath / size) */
.property-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 4px;
}

.prop-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11.5px;
    color: #555;
    white-space: nowrap;
}

.prop-meta-item i {
    color: var(--primary-color);
    font-size: 10px;
}

.property-price {
    color: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
}

/* ============================================================================
   FEATURES SECTION
   ============================================================================ */

.bg-light {
    background-color: var(--light-color) !important;
    border-radius: 0;
}

.icon-box {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

/* ============================================================================
   CALL TO ACTION
   ============================================================================ */

.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
}

.cta-section h2 {
    color: white;
    margin-bottom: 0;
}

.cta-section p {
    opacity: 0.9;
    margin-bottom: 0;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    color: white;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer h5, footer h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
}

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

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    background-color: transparent !important;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px color-mix(in srgb, var(--primary-color) 40%, transparent);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    opacity: 0.92;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary-color) 30%, transparent);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.btn-light {
    background: white;
    color: var(--primary-color);
    border: none;
    font-weight: 600;
}

.btn-light:hover {
    background: var(--light-color);
}

/* ============================================================================
   CARDS & ALERTS
   ============================================================================ */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    background-color: color-mix(in srgb, var(--success-color) 15%, white);
    border-color: var(--success-color);
    color: color-mix(in srgb, var(--success-color) 60%, black);
}

.alert-danger {
    background-color: color-mix(in srgb, var(--danger-color) 15%, white);
    border-color: var(--danger-color);
    color: color-mix(in srgb, var(--danger-color) 60%, black);
}

.alert-info {
    background-color: color-mix(in srgb, var(--info-color) 15%, white);
    border-color: var(--info-color);
    color: color-mix(in srgb, var(--info-color) 60%, black);
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary-color) 25%, transparent);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-search-row {
        grid-template-columns: 1fr 1fr;
    }

    .btn-hero-search {
        grid-column: 1 / -1;
        justify-content: center;
        height: auto;
        padding: 10px;
    }

    .hero-stats-bar {
        gap: 14px;
    }

    .hstat-num {
        font-size: 1.2rem;
    }

    section {
        padding: 40px 0;
    }

    section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-banner {
        padding: 50px 0 40px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-desc {
        font-size: 0.95rem;
    }

    .hero-search-card {
        padding: 14px;
    }

    .hero-search-row {
        grid-template-columns: 1fr;
    }

    .btn-hero-search {
        justify-content: center;
        height: auto;
        padding: 10px;
    }

    .hero-stats-bar {
        gap: 10px;
        flex-wrap: wrap;
    }

    .hstat-sep {
        display: none;
    }

    .hstat {
        flex: 1;
        align-items: center;
        min-width: 60px;
    }
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.fw-500 {
    font-weight: 500;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shadow-lg {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.rounded-lg {
    border-radius: 12px;
}

/* Safety net: ensure content is never permanently invisible */
.card, .property-card, section h2, .hero-banner, .hero-title,
.hero-search-card, .hero-stats-bar, .hero-listings-panel {
    opacity: 1 !important;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.6s ease-out;
}
