/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation — use theme primary when navigation.php defines --primary */
header {
    background-color: var(--primary, #2c3e50);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 2000px;
}

nav h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #3498db;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown > a {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary, #2c3e50);
    list-style: none;
    padding: 0.5rem 0;
    margin-top: 0;
    padding-top: 0.5rem;
    min-width: 220px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    display: block;
}

/* Create a hoverable bridge between dropdown link and menu */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #3498db;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: transparent;
    border: none;
    gap: 4px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 3rem;
    border-radius: 10px;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

body h1,
body h2,
body h3 {
    color: var(--title);
}
.hero h1,
.hero h2,
.hero h3 {
    color: #fff;
}

code.id-badge,
code.agent-id {
    background: rgba(0,0,0,0.06);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
    color: inherit;
}
body.theme-dark code.id-badge,
body.theme-dark code.agent-id {
    background: rgba(255,255,255,0.12);
    color: var(--text);
}
body.theme-dark table code {
    background: rgba(255,255,255,0.12) !important;
    color: var(--text) !important;
}
/* Slightly lift table rows in dark mode for readability */
body.theme-dark table tbody tr {
    background: #1c232d;
}
body.theme-dark table tbody tr:nth-child(even) {
    background: #1f2732;
}
body.theme-dark table tbody tr:hover {
    background: #242f3c;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Properties Section */
.properties-section {
    margin: 3rem 0;
}

.properties-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.property-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.property-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

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

.property-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.property-card .price {
    font-size: 1.5rem;
    color: #27ae60;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.property-card .location {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background-color: var(--primary, #2c3e50);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav .container {
        flex-wrap: wrap;
        position: relative;
    }
    
    nav h1 {
        font-size: 1.2rem;
        flex: 1;
    }
    
    .hamburger {
        display: flex;
        order: 2;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--primary, #2c3e50);
        padding: 1rem 0;
        margin-top: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        gap: 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu > li:last-child {
        border-bottom: none;
    }
    
    .nav-menu > li > a {
        padding: 1rem;
        width: 100%;
        border-radius: 0;
    }
    
    .nav-menu .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        margin-top: 0;
        padding: 0;
        background: rgba(0, 0, 0, 0.2);
    }
    
    .nav-menu .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .nav-menu .dropdown-menu a {
        padding-left: 2rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero > div {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero > div > a {
        width: 100%;
        max-width: 300px;
        margin-right: 0 !important;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
}

/* Form row — collapse to single column on mobile */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr !important;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

