/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --main-bg: #f4f6f8;       
    --card-bg: #ffffff;       
    --header-bg: #ffffff;     
    --text-main: #333333;     
    --text-light: #ffffff;    
    --text-gray: #666666;     
    --accent-blue: #008eb3;
    --accent-hover: #006f8c;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0,0,0,0.05); 
}

* { box-sizing: border-box; }

body {
    background-color: var(--main-bg);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    word-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
.main-header, header {
    background-color: var(--header-bg);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--accent-blue);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: var(--accent-blue); 
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo img { height: 40px; width: auto; }

nav { display: flex; align-items: center; gap: 20px; }

nav a {
    color: var(--text-main); 
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.3s;
    white-space: nowrap;
}
nav a:hover { color: var(--accent-blue); }

.btn-submit {
    background-color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .main-header, header { flex-direction: column; gap: 15px; padding: 15px; }
    nav { flex-wrap: wrap; justify-content: center; width: 100%; gap: 15px; }
    .logo { width: 100%; justify-content: center; }
}

/* =========================================
   3. HERO & BANNERS
   ========================================= */
.hero-slider-container { position: relative; height: 500px; width: 100%; background: #333; overflow: hidden; }
.hero-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; opacity: 0; transition: opacity 1s ease-in-out; z-index: 1; }
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-content { position: relative; z-index: 3; padding: 20px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); width: 90%; max-width: 800px; }
.hero-content h1 { font-size: clamp(28px, 5vw, 48px); margin-bottom: 10px; color: white; }
.hero-content p { font-size: clamp(16px, 3vw, 20px); font-style: italic; color: #f0f0f0; }

.page-banner, .contact-hero { 
    background-size: cover; 
    background-position: center; 
    height: 200px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 40px; 
}
.page-banner h1, .contact-hero h1 { 
    color: white; 
    font-size: clamp(24px, 5vw, 32px); 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    text-align: center; 
    padding: 0 10px; 
}

.hero-search-wrapper { position: absolute; bottom: 60px; left: 0; right: 0; z-index: 10; display: flex; justify-content: center; pointer-events: none; padding: 0 15px; }
.search-container { pointer-events: auto; display: flex; width: 100%; max-width: 700px; background: rgba(255,255,255,0.95); padding: 10px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); gap: 5px; }
.search-input { flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 16px; outline: none; }
.search-btn { background: var(--accent-blue); color: white; border: none; padding: 0 25px; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 16px; white-space: nowrap; }

@media (max-width: 600px) {
    .hero-slider-container { height: 350px; }
    .hero-search-wrapper { bottom: 20px; }
    .search-container { flex-direction: column; padding: 15px; }
    .search-input { width: 100%; margin-bottom: 5px; }
    .search-btn { width: 100%; padding: 12px; }
}

/* =========================================
   4. FORMS (EDIT / SUBMIT)
   ========================================= */
.form-section { background: #fff; padding: 25px; margin-bottom: 20px; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
.form-section h3 { color: #555; font-size: 16px; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 20px; text-transform: uppercase; font-weight: 600; }
.row { display: flex; gap: 20px; margin-bottom: 15px; }
.col { flex: 1; display: flex; flex-direction: column; }
label { margin-bottom: 5px; font-size: 13px; color: #555; font-weight: 600; }
input, select, textarea { background: #f9f9f9; border: 1px solid #ccc; color: #333; padding: 10px; border-radius: 4px; width: 100%; font-size: 16px; }
.radio-group { display: flex; gap: 15px; align-items: center; height: 40px; flex-wrap: wrap; }
.radio-group label { margin: 0; cursor: pointer; color: #333; }

.current-images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-bottom: 20px; }
.image-container { position: relative; width: 100%; height: 100px; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.image-container img { width: 100%; height: 100%; object-fit: cover; }
.remove-btn { position: absolute; top: 5px; right: 5px; background: red; color: white; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

@media (max-width: 768px) {
    .row { flex-direction: column; gap: 15px; }
}

/* =========================================
   5. AGENTS PAGE
   ========================================= */
.agents-container { max-width: 1000px; margin: 0 auto 100px; padding: 0 20px; }
.agent-card { display: flex; align-items: center; margin-bottom: 40px; background: var(--card-bg); padding: 20px; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--border-color); gap: 30px; }
.agent-image-box { width: 180px; height: 180px; flex-shrink: 0; border-radius: 50%; overflow: hidden; border: 3px solid var(--accent-blue); }
.agent-image-box img { width: 100%; height: 100%; object-fit: cover; }
.agent-info { flex: 1; color: var(--text-gray); }
.agent-name { font-size: 24px; color: var(--text-main); text-transform: uppercase; margin: 0 0 5px 0; font-weight: bold; }
.agent-role { font-size: 16px; color: var(--accent-blue); margin-bottom: 15px; font-weight: 600; }

@media (max-width: 768px) {
    .agent-card { flex-direction: column; text-align: center; }
    .agent-info { width: 100%; }
}

/* =========================================
   6. CONTACT PAGE
   ========================================= */
.contact-wrapper { max-width: 1100px; margin: 0 auto 80px; padding: 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-left h2 { color: #008eb3; text-transform: uppercase; margin-bottom: 25px; }
.contact-input { width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; }
.contact-btn { background: #008eb3; color: white; border: none; padding: 15px 40px; font-weight: bold; cursor: pointer; float: right; border-radius: 4px; }
.contact-right { background: #fff; padding: 40px; text-align: center; border: 1px solid #e0e0e0; border-radius: 8px; }

@media (max-width: 768px) {
    .contact-wrapper { grid-template-columns: 1fr; gap: 30px; }
    .contact-btn { width: 100%; }
}

/* =========================================
   7. CONTENT PAGES (ABOUT, TERMS, MARKET)
   ========================================= */
.content-container, .analysis-container { max-width: 1000px; margin: 0 auto 80px; padding: 40px; background: #262626; border: 1px solid #333; color: #ddd; line-height: 1.8; }
.content-container h2, .section-title { color: #008eb3; font-size: 22px; margin-bottom: 15px; border-bottom: 1px solid #444; padding-bottom: 10px; }
.highlight-box { background: #1a1a1a; padding: 20px; border-left: 4px solid #008eb3; margin: 20px 0; }
ul.custom-list { list-style: none; padding-left: 0; }
ul.custom-list li { position: relative; padding-left: 25px; margin-bottom: 10px; }
ul.custom-list li::before { content: "•"; color: #008eb3; font-weight: bold; position: absolute; left: 0; font-size: 20px; line-height: 1; }

@media (max-width: 768px) {
    .content-container, .analysis-container { padding: 20px; width: 95%; margin-bottom: 40px; }
}

/* =========================================
   8. LOGIN / REGISTER
   ========================================= */
.login-container, .register-container { display: flex; justify-content: center; align-items: center; padding: 80px 20px; min-height: 60vh; }
.login-box, .register-box { background: #262626; padding: 40px; width: 100%; max-width: 400px; border: 1px solid #333; text-align: center; }
.login-box h2, .register-box h2 { color: #008eb3; margin-bottom: 20px; text-transform: uppercase; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; color: #aaa; font-size: 14px; }
.form-group input { width: 100%; padding: 12px; background: #1a1a1a; border: 1px solid #444; color: white; border-radius: 4px; font-size: 16px; }
.btn-login, .btn-register { width: 100%; padding: 12px; background: #008eb3; color: white; border: none; font-weight: bold; cursor: pointer; text-transform: uppercase; margin-top: 10px; border-radius: 4px;}
.error-alert { background: #ff4d4d; color: white; padding: 10px; font-size: 13px; margin-bottom: 20px; border-radius: 4px; text-align: left; }

/* =========================================
   9. ADMIN DASHBOARD
   ========================================= */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding: 20px; }
.admin-card { background: #fff; padding: 15px; border: 1px solid #eee; border-radius: 8px; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.status-badge { position: absolute; top: 10px; right: 10px; background: var(--accent-blue); color: white; padding: 4px 10px; font-size: 11px; font-weight: bold; border-radius: 4px; }

@media (max-width: 600px) {
    .admin-grid { grid-template-columns: 1fr; padding: 10px; }
}

/* =========================================
   10. FILTERS SECTION
   ========================================= */
.filters-section { background: #fff; padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.filters-grid { max-width: 1200px; margin: auto; padding: 0 15px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; align-items: start; }
.filter-col { display: flex; flex-direction: column; border: 1px solid #eee; border-radius: 6px; overflow: hidden; }
.filter-header { background: var(--accent-blue); color: white; padding: 10px; text-align: center; font-weight: bold; font-size: 14px; cursor: default; }
.filter-header.clickable { cursor: pointer; background: #007799; }
.filter-link { background: #f8f9fa; color: var(--text-main); padding: 12px; text-align: center; display: block; text-decoration: none; border-top: 1px solid #eee; font-size: 13px; transition: background 0.2s; }
.filter-link:hover { background: #e9ecef; color: var(--accent-blue); }
.more-menu-dropdown { display: none; flex-direction: column; }

/* =========================================
   11. PROPERTY GRIDS (FIXED FOR ROWS & FULL VISIBILITY)
   ========================================= */
.property-grid-container { 
    padding: 40px 5%; 
    max-width: 1400px; 
    margin: auto; 
    width: 100%;
}

.property-grid { 
    display: grid; 
    /* This setup ensures cards fill the width, forcing rows of 3-4 on desktop */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 30px; 
    width: 100%;
}

.property-card { 
    background-color: var(--card-bg); 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.08); 
    border: 1px solid var(--border-color); 
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.image-container { 
    position: relative; 
    width: 100%; 
    height: 250px; /* Fixed height forces uniform rows */
    background: #000; /* Dark background enhances photo visibility */
    overflow: hidden;
}

/* IMAGE FIX: Object-fit CONTAIN ensures the WHOLE image is visible without cropping */
.image-container img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

.details { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 16px; margin: 0 0 10px 0; font-weight: 600; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { color: var(--accent-blue); font-size: 18px; font-weight: bold; margin-bottom: 10px; }
.specs-row { display: flex; gap: 15px; color: var(--text-gray); margin-bottom: 15px; font-size: 13px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.action-row { display: flex; justify-content: space-between; margin-top: auto; }
.btn-action { padding: 8px 12px; border-radius: 4px; text-decoration: none; font-size: 12px; font-weight: 600; border: 1px solid #ddd; background: #f9f9f9; color: #333; }

/* =========================================
   12. DETAILS PAGE
   ========================================= */
.page-title { text-align: center; padding: 30px 15px; background: #fff; border-bottom: 1px solid #eee; }
.page-title h1 { font-size: clamp(20px, 5vw, 28px); margin: 0; word-wrap: break-word; color: #333; text-transform: uppercase; }
.container { max-width: 1200px; margin: 30px auto; padding: 0 5%; width: 100%; }
.top-section { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin-bottom: 40px; }
.gallery-main { height: 450px; border: 1px solid #ddd; position: relative; background: #f9f9f9; border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.gallery-thumbs img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; border: 2px solid transparent; cursor: pointer; flex-shrink: 0; }
.contact-box { background: #fff; border: 1px solid #eee; padding: 20px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); height: fit-content; }
.section-header { border-bottom: 2px solid var(--accent-blue); margin-bottom: 20px; padding-bottom: 5px; }
.section-header h2 { margin: 0; font-size: 18px; color: #333; text-transform: uppercase; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.info-item, .feature-item { border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; font-size: 14px; display: flex; justify-content: space-between; color: #555; flex-wrap: wrap; }
.description { line-height: 1.6; color: #555; margin: 40px 0; font-size: 16px; word-break: break-word; }

@media (max-width: 900px) {
    .top-section { display: flex; flex-direction: column; gap: 20px; }
    .gallery-main { height: 250px; }
}
@media (max-width: 600px) {
    .features-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
}

/* =========================================
   13. FOOTER
   ========================================= */
footer { background: var(--accent-blue); color: white; padding: 40px 20px 20px; margin-top: auto; width: 100%; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
.footer-col h3 { font-size: 15px; margin-bottom: 15px; text-transform: uppercase; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 5px; display: inline-block;}
.footer-col ul { list-style: none; padding: 0; font-size: 14px; line-height: 2; }
.footer-col a { color: rgba(255,255,255,0.9); text-decoration: none; }
.footer-bottom { background: var(--accent-hover); padding: 20px; font-size: 12px; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 40px; border-radius: 4px; }
.social-icons { display: flex; gap: 15px; }
.social-icons a { color: white; font-size: 18px; }

@media (max-width: 600px) {
    .footer-grid { display: flex; flex-direction: column; text-align: center; }
}

/* =========================================
   14. FLOATING VIDEO & MISC
   ========================================= */
.floating-player { position: fixed; bottom: 20px; right: 20px; width: 320px; height: 200px; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 9999; border-radius: 8px; overflow: hidden; border: 2px solid var(--accent-blue); display: flex; flex-direction: column; }
.drag-handle { width: 100%; height: 25px; background: var(--accent-blue); cursor: move; display: flex; align-items: center; justify-content: flex-end; padding-right: 5px; }
@media (max-width: 600px) {
    .floating-player { width: 90% !important; height: auto !important; aspect-ratio: 16/9; right: 5% !important; left: 5% !important; bottom: 10px !important; top: auto !important; }
}

.agents-section { background: #f0f2f5; padding: 60px 20px; text-align: center; }
.agents-btn { background: var(--accent-blue); color: white; border: 2px solid var(--accent-blue); padding: 12px 30px; font-weight: bold; border-radius: 30px; cursor: pointer; }
.no-results { text-align: center; padding: 50px 20px; color: #666; }
.no-results i { font-size: 60px; margin-bottom: 15px; color: #ddd; }