/* =============================================
   PUBLISH BUTTON
   ============================================= */
#publish-btn {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    padding: 7px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
#publish-btn:hover { background: var(--accent); color: #1a1a2e; transform: scale(1.04); }

/* =============================================
   AUTH MODAL
   ============================================= */
.auth-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(3px);
    animation: authFadeIn 0.25s ease;
}
.auth-modal-wrap.hidden { display: none; }

@keyframes authFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.auth-modal-box {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 36px 36px 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: authSlideUp 0.3s ease;
    max-height: 92vh;
    overflow-y: auto;
}

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

.auth-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
}
.auth-close:hover { color: var(--text-dark); background: #f0f0f0; }

.auth-icon { font-size: 2.2rem; line-height: 1; }

.auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    text-align: center;
}

.auth-sub {
    font-size: 0.88rem;
    color: var(--text-mid);
    text-align: center;
    line-height: 1.6;
    margin: 0;
    max-width: 340px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.auth-tab {
    flex: 1;
    padding: 9px;
    border: none;
    background: #fff;
    color: #999;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border-right: 1px solid #e0e0e0;
}
.auth-tab:last-child { border-right: none; }
.auth-tab.active { background: var(--primary); color: #fff; }
.auth-tab:not(.active):hover { background: #f5f5f5; color: var(--text-dark); }

.auth-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.auth-panel.hidden { display: none; }

.auth-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-dark);
    outline: none;
    transition: border-color var(--transition);
    background: #fafafa;
}
.auth-input:focus { border-color: var(--accent); background: #fff; }
.auth-input.error { border-color: #e74c3c; }

.auth-btn {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background var(--transition), transform var(--transition);
}
.auth-btn:hover { background: #003399; transform: translateY(-1px); }

.auth-note {
    font-size: 0.75rem;
    color: #bbb;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* Payment placeholder */
.payment-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: #f7f5f0;
    border-radius: 12px;
    border: 1px dashed var(--accent);
    text-align: center;
    width: 100%;
}
.payment-icon { font-size: 2rem; }
.payment-title { font-weight: 700; font-size: 1rem; color: var(--primary); }
.payment-price {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.payment-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-mid);
    font-family: inherit;
}
.payment-note { font-size: 0.82rem; color: var(--text-mid); line-height: 1.6; }

@media (min-width: 520px) {
    .auth-modal-wrap { align-items: center; padding: 24px; }
    .auth-modal-box { border-radius: 20px; max-width: 440px; }
}

/* =============================================
   ROOT & RESET
   ============================================= */
:root {
    --primary: #002171;
    --primary-dark: #000d36;
    --accent: #d4af37;
    --accent-light: #f0d060;
    --text-dark: #1a1a2e;
    --text-mid: #555;
    --text-light: #fff;
    --bg-light: #f7f5f0;
    --bg-white: #ffffff;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.10);
    --shadow-hover: 0 8px 32px rgba(0,0,0,0.16);
    --transition: 0.25s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
}

/* =============================================
   APP NAV
   ============================================= */
#app-nav {
    background: linear-gradient(90deg, #1a1a2e, #16213e);
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

#nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-icon { font-size: 1.3rem; }

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

#save-btn {
    background: var(--accent);
    color: #1a1a2e;
    border: none;
    padding: 7px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: background var(--transition), transform var(--transition);
}
#save-btn:hover { background: var(--accent-light); transform: scale(1.04); }

.preview-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.toggle-label { opacity: 0.8; }

.switch { position: relative; display: inline-block; width: 48px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #555;
    border-radius: 24px;
    transition: .3s;
}
.slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}
input:checked + .slider { background: var(--accent); }
input:checked + .slider:before { transform: translateX(24px); }

/* =============================================
   MAIN CONTAINER
   ============================================= */
#main-container { margin-top: 56px; }

/* =============================================
   BANNER
   ============================================= */
#banner {
    position: relative;
    width: 100%;
    height: 340px;
    overflow: hidden;
}

#banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    background-size: cover;
    background-position: center;
    z-index: 1;
    transition: background var(--transition);
}

/* Subtle dark overlay so text always reads well over photos */
#banner-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.1) 60%, rgba(0,0,0,0.3) 100%);
}

#banner-content {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 60px;
}

#agent-name {
    font-family: 'Great Vibes', cursive;
    font-size: 6rem;
    color: var(--accent);
    cursor: text;
    outline: none;
    text-shadow: 2px 3px 12px rgba(0,0,0,0.5);
    line-height: 1.1;
    max-width: 70%;
    word-break: break-word;
}

body.edit-mode #agent-name:hover {
    background: rgba(255,255,255,0.07);
    border-radius: 6px;
}

/* Logo */
#logo-container {
    width: 130px;
    height: 130px;
    border-radius: var(--radius);
    border: 2px dashed rgba(255,255,255,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    background-color: rgba(255,255,255,0.08);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
    transition: border-color var(--transition);
}
#logo-container:hover { border-color: var(--accent); }
#logo-container.has-image { border-style: solid; border-color: rgba(255,255,255,0.2); }
#logo-container.has-image #logo-placeholder { display: none; }

#logo-fit-btn {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 0.68rem;
    cursor: pointer;
    white-space: nowrap;
    display: none !important;
}
body.edit-mode #logo-container.has-image #logo-fit-btn { display: block !important; }

/* ---- Banner Toolbar ---- */
#banner-toolbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(10, 10, 30, 0.82);
    backdrop-filter: blur(8px);
    padding: 8px 20px;
    flex-wrap: wrap;
    gap: 6px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-label {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.15);
    margin: 0 10px;
}

.toolbar-btn {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background var(--transition);
    white-space: nowrap;
}
.toolbar-btn:hover { background: rgba(255,255,255,0.22); }
.toolbar-btn.danger { border-color: rgba(255,80,80,0.4); color: #ff9090; }
.toolbar-btn.danger:hover { background: rgba(255,80,80,0.2); }

.color-swatch-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}
.color-swatch-label span {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.55);
}
.color-swatch-label input[type="color"] {
    width: 30px;
    height: 22px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    background: none;
}

#font-picker, #bg-style-picker, #bg-grad-dir {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}
#font-picker option, #bg-style-picker option, #bg-grad-dir option { background: #1a1a2e; color: #fff; }

.size-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
}
.size-label input[type="range"] {
    width: 90px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Gold accent bar below banner */
#banner-accent-bar {
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
}

/* =============================================
   BIO SECTION
   ============================================= */
#bio-section {
    background: transparent;
    padding: 60px;
    position: relative;
}

#bio-inner {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto;
}

/* Profile Photo */
#agent-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--primary);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    background: #e8eaf6;
    box-shadow: 0 4px 20px rgba(0,33,113,0.2);
    transition: box-shadow var(--transition);
}
#agent-photo:hover { box-shadow: 0 6px 28px rgba(0,33,113,0.35); }
#photo-img { width: 100%; height: 100%; object-fit: cover; display: none; }
#photo-img.has-image { display: block; }

#bio-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#agent-fullname {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    outline: none;
    line-height: 1.2;
}

#agent-title {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.3px;
    outline: none;
    text-transform: uppercase;
}

#agent-contact {
    font-size: 0.9rem;
    color: var(--text-mid);
    outline: none;
    padding: 6px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Bio gold left border */
#bio-text {
    font-size: 1rem;
    color: var(--text-mid);
    line-height: 1.8;
    outline: none;
    padding: 10px 16px;
    border-left: 3px solid var(--accent);
    background: #fdfaf3;
    border-radius: 0 6px 6px 0;
}

/* Specialties chips */
#specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.chip {
    background: var(--primary);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    outline: none;
    cursor: text;
    transition: background var(--transition);
}
.chip:hover { background: #003399; }


#bio-social { margin-top: 4px; }
.social-hint {
    font-size: 0.78rem;
    color: #aaa;
    font-style: italic;
}

/* Editable hover highlight */
body.edit-mode .editable-text:hover {
    background: rgba(212,175,55,0.08);
    border-radius: 4px;
    outline: 1px dashed rgba(212,175,55,0.4);
}

/* =============================================
   STATS BAR
   ============================================= */
#stats-bar {
    background: var(--primary);
    padding: 30px 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    max-width: 100%;
}

.stat-item {
    flex: 1;
    text-align: center;
    max-width: 200px;
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--accent);
    outline: none;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-divider {
    width: 1px;
    height: 50px;
    background: rgba(255,255,255,0.15);
    margin: 0 20px;
}

body.edit-mode .stat-number:hover {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
}

/* =============================================
   PROPERTIES SECTION
   ============================================= */
#properties-section {
    padding: 60px;
    background: transparent;
    position: relative;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 36px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.section-sub {
    font-size: 0.85rem;
    color: #999;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
}
.primary-btn:hover { background: #003399; transform: translateY(-1px); }

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Property Card */
.property-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #e8e8e8;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}
.property-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.property-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #dde0e8;
    cursor: pointer;
}

.property-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #dde0e8;
    transition: opacity 0.3s ease;
    display: none;
}
.property-img.has-image { display: block; }

.prop-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 2.5rem;
    gap: 6px;
}
.prop-img-placeholder small { font-size: 0.8rem; }
.prop-img-placeholder.hidden { display: none; }

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    padding: 8px 13px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    border-radius: 5px;
}
.prev-arrow { left: 10px; }
.next-arrow { right: 10px; }
.property-image-container:hover .slider-arrow { opacity: 1; }
/* Always show arrows on touch devices */
@media (hover: none) { .slider-arrow { opacity: 1; } }
.slider-arrow:hover { background: var(--accent); color: var(--primary); }

.img-count-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 12px;
    z-index: 5;
}

.property-details { padding: 20px; }

.property-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
    outline: none;
}
.property-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    outline: none;
    line-height: 1.4;
}
.property-info {
    font-size: 0.85rem;
    color: var(--text-mid);
    line-height: 1.5;
    outline: none;
}

.card-actions {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
}
.card-btn {
    flex: 1;
    padding: 7px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background var(--transition);
}
.card-btn.upload-btn { background: #e8f0fe; color: var(--primary); }
.card-btn.upload-btn:hover { background: #c5d8ff; }
.card-btn.remove-btn { background: #fce8e8; color: #c0392b; }
.card-btn.remove-btn:hover { background: #f5c6c6; }

.property-cta {
    padding: 0 20px 18px;
}

.view-listing-btn {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), color var(--transition);
}
.view-listing-btn:hover { border-bottom-color: var(--accent); color: var(--primary); }

/* =============================================
   FOOTER
   ============================================= */
#page-footer {
    background: linear-gradient(135deg, #0d1117, #1a1a2e);
    color: rgba(255,255,255,0.7);
    padding: 36px 60px 20px;
}

#footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto 20px;
    gap: 20px;
    flex-wrap: wrap;
}

#footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

#footer-logo { max-height: 40px; display: none; }
#footer-logo.has-image { display: block; }

#footer-text {
    font-size: 0.82rem;
    outline: none;
    color: rgba(255,255,255,0.5);
}

#footer-social {
    display: flex;
    gap: 12px;
}

.social-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.social-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    cursor: pointer;
}
.social-link:hover { background: var(--accent); color: #1a1a2e; border-color: var(--accent); }
body.edit-mode .social-link { border-style: dashed; }
body.edit-mode .social-link.has-link { border-style: solid; border-color: rgba(212,175,55,0.5); }

.social-edit-pop {
    display: none;
    position: absolute;
    bottom: 52px;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 10px;
    padding: 12px;
    flex-direction: column;
    gap: 8px;
    width: 260px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.4);
    z-index: 100;
}
.social-edit-pop.open { display: flex; }

.social-edit-pop input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.07);
    color: #fff;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
}
.social-edit-pop input:focus { border-color: var(--accent); }
.social-edit-pop input::placeholder { color: rgba(255,255,255,0.3); }

.social-field-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: -4px;
}

.social-save-btn {
    background: var(--accent);
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    align-self: flex-end;
    transition: background var(--transition);
}
.social-save-btn:hover { background: var(--accent-light); }

body.preview-mode .social-edit-pop { display: none !important; }

#footer-tagline {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
    max-width: 1100px;
    margin: 0 auto;
}

/* =============================================
   LISTING PAGE (full-page overlay)
   ============================================= */
#listing-page {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: var(--bg-light);
    overflow-y: auto;
    animation: lpSlideIn 0.3s ease;
}
#listing-page.open { display: block; }

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

/* Sticky top bar */
#lp-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(90deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 58px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

#lp-back {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 7px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background var(--transition);
}
#lp-back:hover { background: var(--accent); color: #1a1a2e; border-color: var(--accent); }

#lp-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

#lp-agent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
    background: #2a2a4e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
    font-size: 1rem;
    flex-shrink: 0;
}
#lp-avatar-img { width: 100%; height: 100%; object-fit: cover; display: none; }
#lp-avatar-img.visible { display: block; }

#lp-agent-mini-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
}
#lp-agent-mini-title {
    font-size: 0.72rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Body */
#lp-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

/* Gallery */
#lp-gallery { display: flex; flex-direction: column; gap: 8px; }

#lp-hero-wrap {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#lp-hero-img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: none;
    border-radius: 12px;
}
#lp-hero-img.visible { display: block; }

#lp-no-photo {
    width: 100%;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.25);
    font-size: 3.5rem;
    gap: 12px;
    padding: 60px 0;
}
#lp-no-photo span { font-size: 0.9rem; }
#lp-no-photo.hidden { display: none; }

.lp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 12px 18px;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 8px;
    z-index: 5;
    transition: background var(--transition);
}
.lp-arrow:hover { background: var(--accent); color: var(--primary); }
#lp-prev { left: 16px; }
#lp-next { right: 16px; }
/* Always visible on touch */
@media (hover: none) { .lp-arrow { opacity: 1; } }

#lp-counter {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.78rem;
    padding: 4px 12px;
    border-radius: 12px;
}

#lp-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
#lp-thumbs::-webkit-scrollbar { height: 4px; }
#lp-thumbs::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }

.lp-thumb {
    width: 100px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.55;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: opacity 0.2s, border-color 0.2s;
}
.lp-thumb:hover { opacity: 0.85; }
.lp-thumb.active { opacity: 1; border-color: var(--accent); }

/* Details */
#lp-details {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 36px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#lp-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

#lp-price {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

#lp-status-badge {
    background: var(--accent);
    color: #1a1a2e;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#lp-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

#lp-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lp-feature {
    background: #f0f4ff;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dce8ff;
}

.lp-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #aaa;
}

#lp-description {
    font-size: 0.95rem;
    color: var(--text-mid);
    line-height: 1.85;
    padding: 16px 20px;
    border-left: 3px solid var(--accent);
    background: #fdfaf3;
    border-radius: 0 8px 8px 0;
}

/* Agent card */
#lp-agent-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: #f7f5f0;
    border-radius: 10px;
    border: 1px solid #eee;
}

#lp-agent-photo-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    flex-shrink: 0;
    background: #e8eaf6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #aaa;
}
#lp-agent-photo { width: 100%; height: 100%; object-fit: cover; display: none; }
#lp-agent-photo.visible { display: block; }

#lp-agent-info { display: flex; flex-direction: column; gap: 3px; }
#lp-agent-name { font-weight: 700; font-size: 1rem; color: var(--primary); }
#lp-agent-title { font-size: 0.75rem; color: var(--accent); font-weight: 600; text-transform: uppercase; }
#lp-agent-contact { font-size: 0.82rem; color: var(--text-mid); margin-top: 2px; }

/* CTA */
#lp-cta-row {
    display: flex;
    gap: 12px;
}
#lp-cta-row a {
    flex: 1;
    text-align: center;
    padding: 13px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
}
#lp-whatsapp { background: #25d366; color: #fff; }
#lp-whatsapp:hover { background: #1ebe5d; transform: translateY(-1px); }
#lp-email { background: var(--primary); color: #fff; }
#lp-email:hover { background: #003399; transform: translateY(-1px); }

/* Listing type toggle (edit mode) & badge (preview mode) */
.listing-type-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
    width: fit-content;
}
.lt-btn {
    padding: 4px 14px;
    border: none;
    background: #f0f0f0;
    color: #888;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.lt-btn.active.lt-sale { background: var(--primary); color: #fff; }
.lt-btn.active.lt-rent { background: #1a7a4a; color: #fff; }

.listing-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.lt-sale-badge { background: var(--accent); color: #1a1a2e; }
.lt-rent-badge { background: #1a7a4a; color: #fff; }
body.edit-mode .listing-type-badge { display: none; }

/* Listing page status badge variants */
#lp-status-badge.lp-badge-sale { background: var(--accent); color: #1a1a2e; }
#lp-status-badge.lp-badge-rent { background: #1a7a4a; color: #fff; }


.card-extra-fields {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px dashed #e0e0e0;
    margin-top: 4px;
    padding-top: 14px;
}

.prop-detailed-desc {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.82rem;
    color: var(--text-dark);
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
    background: #fafafa;
}
.prop-detailed-desc:focus { outline: none; border-color: var(--accent); background: #fff; }

.prop-extra-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.prop-field {
    flex: 1;
    min-width: 100px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text-dark);
    background: #fafafa;
    font-family: inherit;
}
.prop-field:focus { outline: none; border-color: var(--accent); background: #fff; }
.prop-field::placeholder { color: #bbb; }

.prop-amenities { flex: unset; width: 100%; }

.prop-pet-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: var(--text-mid);
    cursor: pointer;
    user-select: none;
}
.prop-pet-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Listing page — extra details */
#lp-extra-details {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.lp-extra-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.lp-extra-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f4ff;
    border: 1px solid #dce8ff;
    border-radius: 8px;
    padding: 10px 16px;
    min-width: 130px;
}

.lp-extra-icon { font-size: 1.2rem; }
.lp-extra-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.8px; color: #999; font-weight: 600; }
.lp-extra-value { font-size: 0.9rem; font-weight: 700; color: var(--primary); margin-top: 1px; }

.lp-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lp-amenity-chip {
    background: var(--primary);
    color: #fff;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Detailed description in listing page */
#lp-detailed-description {
    display: none;
    font-size: 0.95rem;
    color: var(--text-mid);
    line-height: 1.85;
    padding: 16px 20px;
    background: #f7f5f0;
    border-radius: 8px;
    border: 1px solid #ede9df;
    white-space: pre-wrap;
}

#lp-more-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#lp-more-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.lp-more-card {
    background: var(--bg-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #e8e8e8;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}
.lp-more-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.lp-more-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background: #dde0e8;
}
.lp-more-img-placeholder {
    width: 100%;
    height: 150px;
    background: #dde0e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #bbb;
}
.lp-more-info { padding: 12px 14px; }
.lp-more-price { font-weight: 800; font-size: 1rem; color: var(--primary); margin-bottom: 4px; }
.lp-more-title { font-size: 0.82rem; color: var(--text-mid); line-height: 1.4; }

@media (max-width: 768px) {
    #lp-topbar { padding: 0 16px; }
    #lp-body { padding: 24px 16px 60px; }
    #lp-hero-img { max-height: 60vh; }
    #lp-details { padding: 24px 20px; }
    #lp-price { font-size: 1.6rem; }
    .lp-extra-item { min-width: calc(50% - 6px); }
}

/* =============================================
   SHARED IMAGE PLACEHOLDER & OVERLAY
   ============================================= */
.img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(255,255,255,0.5);
    font-size: 2rem;
    text-align: center;
    pointer-events: none;
}
.img-placeholder small { font-size: 0.72rem; }

.edit-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    color: #fff;
    justify-content: center;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 5;
    border-radius: inherit;
    letter-spacing: 0.3px;
}

body.edit-mode .editable-image:hover .edit-overlay { display: flex; }

/* =============================================
   EDIT / PREVIEW MODE VISIBILITY
   ============================================= */
.edit-only { display: flex; }
body.preview-mode .edit-only { display: none !important; }
body.preview-mode .card-actions { display: none !important; }
body.preview-mode .section-sub { display: none; }

body.preview-mode #app-nav { display: none !important; }
body.preview-mode #main-container { margin-top: 0; }

body.preview-mode [contenteditable="true"] {
    cursor: default;
    pointer-events: none;
}
body.preview-mode .editable-image { cursor: default; pointer-events: none; }

/* Edit mode section hover ring */
body.edit-mode .editable-section {
    transition: box-shadow var(--transition);
}
body.edit-mode .editable-section:hover {
    box-shadow: inset 0 0 0 3px rgba(212,175,55,0.35);
}

/* Floating edit FAB (preview mode only) */
#edit-fab {
    display: none;
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 3000;
    background: var(--accent);
    color: #1a1a2e;
    border: none;
    padding: 12px 22px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    transition: transform var(--transition), box-shadow var(--transition);
}
#edit-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.3); }
body.preview-mode #edit-fab { display: block; }


@media (max-width: 768px) {
    #banner { height: auto; min-height: 220px; }
    #banner-content { flex-direction: column; padding: 30px 24px 80px; gap: 20px; align-items: flex-start; }
    #agent-name { font-size: 3.5rem; max-width: 100%; }
    #bio-section { padding: 40px 24px; }
    #bio-inner { flex-direction: column; align-items: center; text-align: center; gap: 30px; }
    #properties-section { padding: 40px 24px; }
    .section-header { flex-direction: column; gap: 16px; }
    #banner-toolbar { gap: 8px; }
    .toolbar-divider { display: none; }
}
