:root {
    /* YOUR COLOR PALETTE */
    --primary: #7065F0;
    --secondary: #100A55;
    --tertiary: #585981;
    --bg-grey: #F5F6F7;
    --text-grey: #757575;
    --border: #EDEFF3;
    --white: #ffffff;
    --black: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-grey);
    color: var(--secondary);
}

/* LAYOUT GRID */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--secondary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 100;
    transition: 0.3s ease;
}

.sidebar-header {
    padding: 30px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header .logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
}

.sidebar-header .logo i {
    color: var(--primary);
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    display: none; /* Hidden on desktop */
    cursor: pointer;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    flex-grow: 1;
}

.menu-item {
    text-decoration: none;
    color: #B0B3C7; /* Softer white for inactive */
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
}

.menu-item:hover {
    color: var(--white);
    background-color: rgba(255,255,255, 0.1);
}

.menu-item.active {
    background-color: var(--primary);
    color: var(--white);
}

.menu-item.logout {
    margin-top: auto;
    margin-bottom: 30px;
    color: #ff6b6b;
}

.spacer {
    flex-grow: 1;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: 260px; /* Width of sidebar */
    padding: 0;
    width: calc(100% - 260px);
}

/* --- TOP HEADER --- */
.top-header {
    background-color: var(--white);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-logo {
    display: none; /* Hidden on desktop */
    align-items: center;
    gap: 15px;
    font-weight: 700;
    font-size: 20px;
    color: var(--secondary);
}

#hamburger {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-grey);
    padding: 10px 20px;
    border-radius: 50px;
    width: 350px;
    border: 1px solid transparent;
}

.search-bar input {
    border: none;
    background: transparent;
    margin-left: 10px;
    outline: none;
    width: 100%;
    color: var(--secondary);
}

.search-bar:focus-within {
    border-color: var(--primary);
    background: var(--white);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
}

.user-info .welcome-text {
    display: block;
    font-size: 12px;
    color: var(--text-grey);
}

.user-info .user-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- DASHBOARD CONTENT --- */
.content-wrapper {
    padding: 40px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 20px; /* NEW: Added this to force space in Signup/Reset modes */
}

.btn-filter {
    background-color: var(--white);
    color: var(--secondary);
    border: 1px solid var(--border);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
}

/* --- LISTINGS GRID (CARD COMPONENT) --- */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.property-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-image {
    height: 200px;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255,255,255,0.9);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-tag.rent { color: var(--primary); }
.status-tag.sale { color: #10B981; } /* Green for Sale */

.heart-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-details {
    padding: 20px;
}

.property-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--secondary);
}

.property-address {
    font-size: 13px;
    color: var(--text-grey);
    margin-bottom: 15px;
}

.property-features {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--tertiary);
    margin-bottom: 20px;
}

.property-features i {
    margin-right: 5px;
    color: var(--primary);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.btn-outline {
    background: none;
    border: 1px solid var(--border);
    color: var(--secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-outline:hover {
    background: var(--secondary);
    color: var(--white);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Hide sidebar */
        width: 280px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        transform: translateX(0); /* Show sidebar */
    }

    .close-sidebar {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .top-header {
        padding: 0 20px;
    }

    .mobile-logo {
        display: flex; /* Show logo in header on mobile */
    }

    .search-bar {
        display: none; /* Hide search on mobile to save space */
    }

    .user-info {
        display: none; /* Hide name on mobile, keep avatar */
    }

    .content-wrapper {
        padding: 20px;
    }

    /* PREVENT IOS ZOOMING: Force inputs to be 16px */
input, select, textarea, 
.form-group input, 
.form-group select,
.login-form-side input {
    font-size: 16px !important;
}

.modal-container {
    width: 95%;        /* Take up almost full width */
    max-height: 80vh;  /* Reduce height to leave room for browser bars/keyboard */
    padding: 20px;     /* Reduce padding to save internal space */
    overflow-y: auto;  /* Ensure scrolling happens INSIDE the box */
    overscroll-behavior: contain; /* Prevents the body behind from scrolling */
}

}

/* --- MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 500px;
    
    /* NEW: Handle height issues */
    max-width: 90%;           /* Keeps it responsive on mobile */
    max-height: 90vh;         /* Never be taller than 90% of the screen */
    overflow-y: auto;         /* Add a scrollbar if the form is too long */
    
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;       /* Helps with z-index */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 { color: var(--secondary); }

#closeModal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 5px; color: var(--text-grey); }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
}

.form-row { display: flex; gap: 15px; }

.btn-submit {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    resize: vertical; /* User can stretch it down */
    font-family: 'Inter', sans-serif;
}

/* --- TABLE STYLES --- */
.table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th {
    background: #FAFAFB;
    text-align: left;
    padding: 15px 20px;
    font-size: 13px;
    color: var(--text-grey);
    font-weight: 600;
}

.dashboard-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--secondary);
}

.dashboard-table tr:last-child td { border-bottom: none; }

.status-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending { background: #FFF4E5; color: #B76E00; }
.status-badge.available { background: #E6F4EA; color: #137333; }
.status-badge.sold { background: #FCE8E6; color: #C5221F; }

.thumb-small {
    width: 50px;
    height: 35px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 10px;
    vertical-align: middle;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-grey);
    transition: 0.2s;
}
.btn-icon:hover { color: #C5221F; } /* Red on hover */

/* --- DETAIL VIEW STYLES --- */

/* Top Nav */
.detail-nav { margin-bottom: 20px; }

/* Hero Slider */
.hero-slider {
    position: relative;
    width: 100%;
    height: 450px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 40px;
    background: #000;
}

.slider-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.slider-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease-in-out;
}

/* Slider Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
}

.slider-btn:hover { background: white; color: var(--secondary); }
.slider-btn.prev { left: 20px; }
.slider-btn.next { right: 20px; }

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
}
.dot.active { background: white; transform: scale(1.2); }

/* Info Container (Split) */
.info-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
}

.info-left { flex: 1; }

.category-tag {
    font-size: 12px;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

#detail-title {
    font-size: 36px;
    color: var(--secondary);
    margin-bottom: 10px;
    font-weight: 700;
}

#detail-price {
    font-size: 32px;
    color: var(--primary); /* The Purple/Blue color */
    font-weight: 700;
    margin-bottom: 10px;
}

#detail-address {
    font-size: 16px;
    color: var(--text-grey);
}
#detail-address i { color: var(--primary); margin-right: 8px; }

/* Right Grid (2x2) */
.info-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 450px; /* Fixed width for the grid area */
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center; /* Center align items */
    text-align: center;
    gap: 10px;
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.stat-card i {
    font-size: 24px;
    color: var(--primary);
    background: #F0EFFF; /* Light purple bg for icon */
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-text { display: flex; flex-direction: column; }
.stat-text .label { font-size: 12px; color: var(--text-grey); margin-bottom: 4px; }
.stat-text .value { font-size: 16px; font-weight: 700; color: var(--secondary); }

/* Sections */
.content-section { margin-bottom: 40px; }

.purple-line-header {
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary);
    border-left: 4px solid var(--primary);
    padding-left: 15px;
    margin-bottom: 20px;
}

.description-text {
    color: var(--text-grey);
    line-height: 1.6;
    font-size: 15px;
}

.map-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Inquiry Section */
.inquiry-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.inquiry-sub {
    color: var(--text-grey);
    margin-bottom: 25px;
    margin-top: -10px;
}

.inquiry-form .form-group label {
    font-weight: 500;
    color: var(--secondary);
}

/* Responsive */
@media (max-width: 900px) {
    .info-container { flex-direction: column; }
    .info-right { width: 100%; }
    .hero-slider { height: 300px; }
}

/* --- INBOX & CHAT STYLES --- */
.inbox-container {
    display: flex;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 600px; /* Fixed height for chat UI */
    overflow: hidden;
    position: relative;
}

/* Sidebar */
.inbox-sidebar {
    width: 300px;
    border-right: 1px solid var(--border);
    background: #FAFAFB;
    display: flex;
    flex-direction: column;
}

.inbox-search {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.inbox-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

#conversation-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
}

.conversation-item:hover { background: #F0F0F5; }
.conversation-item.active { background: #eef2ff; border-left: 3px solid var(--primary); }

.convo-title { font-weight: 600; font-size: 14px; color: var(--secondary); display: block; }
.convo-last-msg { font-size: 12px; color: var(--text-grey); display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-date { font-size: 10px; color: #aaa; float: right; }

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.chat-info h3 { font-size: 16px; margin: 0; color: var(--secondary); }
.chat-info span { font-size: 12px; color: var(--text-grey); }

.messages-feed {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #F8F9FA;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.empty-state {
    text-align: center;
    margin-top: 150px;
    color: var(--text-grey);
}
.empty-state i { font-size: 40px; margin-bottom: 15px; opacity: 0.3; }

/* Bubbles */
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.message-bubble.received {
    align-self: flex-start;
    background: white;
    border: 1px solid var(--border);
    color: var(--secondary);
    border-bottom-left-radius: 2px;
}

.message-time {
    display: block;
    font-size: 10px;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--border);
    background: white;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 50px;
    outline: none;
}

.chat-input-area button {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.chat-input-area button:hover { transform: scale(1.05); }

/* Responsive */
@media (max-width: 768px) {
    .inbox-container { flex-direction: column; height: auto; }
    .inbox-sidebar { width: 100%; height: 200px; }
    .chat-area { height: 400px; }
}

/* Active Heart State */
.heart-btn.active {
    background-color: #FFF0F0;
    border-color: #FF4D4D;
    color: #FF4D4D;
}

.heart-btn.active i {
    font-weight: 900; /* Switches FontAwesome Regular to Solid */
}

/* --- SETTINGS STYLES --- */
.settings-container {
    max-width: 800px;
}

.settings-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.settings-card h3 {
    margin-bottom: 5px;
    color: var(--secondary);
}

.settings-sub {
    color: var(--text-grey);
    font-size: 13px;
    margin-bottom: 25px;
}

/* Avatar Upload */
.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.current-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.toggle-info strong { display: block; font-size: 14px; color: var(--secondary); }
.toggle-info p { font-size: 12px; color: var(--text-grey); }

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }

/* =========================================
   LOGIN & SIGN UP PAGE STYLES
   ========================================= */

/* Specific Body Override */
body.login-body {
    height: 100vh;
    width: 100%;
    overflow: hidden; 
    background-color: var(--white);
}

.login-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* --- LEFT SIDE: BRAND IMAGE --- */
.login-brand {
    flex: 0.8;
    background-image: url('images/carlos-colon-l6KgWD9tRQQ-unsplash.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
}

.brand-overlay {
    background: rgba(16, 10, 85, 0.85);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.brand-content {
    color: var(--white);
    max-width: 450px;
}

.brand-content h1 { font-size: 42px; font-weight: 700; margin-bottom: 20px; }
.brand-content h1 i { color: var(--primary); }
.brand-content p { font-size: 18px; line-height: 1.6; color: #D1D1D1; }

/* --- RIGHT SIDE: FORM --- */
.login-form-side {
    flex: 1;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

/* --- MOBILE LOGO (FIXED) --- */
.mobile-logo-login {
    display: none; /* Hidden on Desktop */
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 60px; /* Big gap for mobile "Welcome Back" */
    text-align: center;
}
.mobile-logo-login i { color: var(--primary); }

.login-form-side h2 { font-size: 28px; color: var(--secondary); margin-bottom: 8px; }
#page-subtitle { color: var(--text-grey); margin-bottom: 30px; }

/* --- BUTTONS & INPUTS --- */
.btn-google {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    color: var(--secondary);
    cursor: pointer;
    transition: 0.2s;
}
.btn-google:hover { background-color: #f8f9fa; border-color: #dce0e4; }
.btn-google img { width: 18px; height: 18px; }

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.divider span { padding: 0 10px; color: #B0B3C7; font-size: 12px; font-weight: 600; }

.login-form-side input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--black);
    outline: none;
    transition: 0.2s;
    background: white;
}
.login-form-side input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(112, 101, 240, 0.1); }

.password-wrapper { position: relative; }
.password-wrapper i { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--text-grey); cursor: pointer; }

/* --- LINKS & SPACING --- */
.forgot-row {
    text-align: right;
    margin-bottom: 0px; /* Removed margin here, moved to button */
}
.forgot-row a { font-size: 13px; color: var(--primary); text-decoration: none; font-weight: 500; }

.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 30px; /* INCREASED: Adds consistent gap above button */
}
.btn-primary:hover { background-color: #5d54c9; }
.btn-primary:disabled { background-color: #a099f0; cursor: not-allowed; }

.toggle-auth {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    color: var(--text-grey);
}
.toggle-auth a { color: var(--primary); text-decoration: none; font-weight: 600; margin-left: 5px; }

/* Force space for "Back to Login" on Reset Page */
#back-to-login-div {
    margin-top: 30px !important;
}

/* --- AUTH ALERTS --- */
.auth-message { padding: 12px; border-radius: 6px; font-size: 13px; margin-bottom: 20px; text-align: center; }
.auth-message.error { background-color: #FCE8E6; color: #C5221F; border: 1px solid #fad2cf; }
.auth-message.success { background-color: #E6F4EA; color: #137333; border: 1px solid #ceead6; }

/* --- RESPONSIVENESS --- */
@media (max-width: 1024px) {
    .login-brand { flex: 0.6; }
}

@media (max-width: 768px) {
    body.login-body { overflow: auto; height: auto; }
    .login-container { flex-direction: column; }
    .login-brand { display: none; }
    .login-form-side { padding: 20px; align-items: flex-start; padding-top: 40px; height: auto; }
    .form-wrapper { padding: 0; max-width: 100%; }
    
    .mobile-logo-login { display: block; } /* Now this matches the HTML class */
    
    .login-form-side h2, #page-subtitle { text-align: center; }
}

/* --- FIXED FILTER ROW STYLES --- */

/* 1. Aligns the two buttons side-by-side vertically */
.filter-buttons {
    display: flex;
    align-items: center; 
    gap: 12px;
}

/* 2. Style specifically for the Filter Button */
.btn-filter {
    background-color: var(--white);
    color: var(--secondary);
    border: 1px solid var(--border);
    padding: 0 20px;
    height: 48px;          /* Fixed height */
    border-radius: 8px;    /* Matches View Map button */
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: #F8F9FF;
}

/* 3. TARGETED FIX: Only affects the 'View Map' button in this row */
.filter-buttons .btn-primary {
    width: auto;     /* Overrides the 100% from Login */
    margin-top: 0;   /* Overrides the margin from Login */
    height: 48px;    /* Matches Filter height */
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Leaflet Map Customization */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}
.leaflet-popup-content {
    margin: 0;
    width: 200px !important;
}
.map-popup-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}
.map-popup-info {
    padding: 12px;
}
.map-popup-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 4px;
}
.map-popup-price {
    font-weight: 700;
    color: var(--primary);
}

#detail-map-obj {
    width: 100%;
    height: 400px; /* Adjust height as needed */
    border-radius: 12px;
    overflow: hidden;
}

/* =========================================
   ADMIN PANEL STYLES
   ========================================= */

/* Dashboard Overview Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.admin-stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.admin-stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #F0EFFF;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Sidebar Notification Badge */
.badge-red {
    background: #FF4D4D;
    color: white;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 11px;
    margin-left: auto;
    font-weight: 600;
}

/* Verified/Admin Listing Badge */
.verified-badge {
    position: absolute;
    top: 15px;
    right: 50px; /* Positioned to the left of the heart icon */
    background: #100A55;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Enhanced Chat Bubbles (Shared by User & Admin) */
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    margin-bottom: 5px;
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.message-bubble.received {
    align-self: flex-start;
    background: white;
    border: 1px solid var(--border);
    color: var(--secondary);
    border-bottom-left-radius: 2px;
}

.message-time {
    display: block;
    font-size: 10px;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}

/* --- NEW: MOBILE INBOX LOGIC (Master-Detail View) --- */

/* 1. Admin Specific Classes (Replaces Inline Styles) */
.admin-inbox-container {
    height: 600px; 
    display: flex; 
    background: white; 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    overflow: hidden;
    position: relative; /* Needed for absolute positioning on mobile */
}

.admin-inbox-sidebar {
    width: 300px; 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column;
    background: #fff;
}

.admin-chat-area {
    flex: 1; 
    display: flex; 
    flex-direction: column;
    background: #F8F9FA;
}

/* 2. Mobile Logic for BOTH User and Admin */
@media (max-width: 768px) {
    
    /* Force containers to fit mobile screen */
    .inbox-container, 
    .admin-inbox-container {
        height: calc(100vh - 160px) !important; /* Adjust height for mobile header */
        flex-direction: column;
        border: none;
    }

    /* DEFAULT STATE: Show List, Hide Chat */
    .inbox-sidebar,
    .admin-inbox-sidebar {
        width: 100% !important;
        height: 100%;
        display: flex; /* Show by default */
        border-right: none;
    }

    .chat-area,
    .admin-chat-area {
        display: none !important; /* Hidden by default */
        width: 100%;
        height: 100%;
        position: absolute; /* Cover the sidebar */
        top: 0;
        left: 0;
        z-index: 20;
        background: white;
    }

    /* ACTIVE STATE: When Chat is Open (Toggled via JS) */
    .inbox-container.chat-active .inbox-sidebar,
    .admin-inbox-container.chat-active .admin-inbox-sidebar {
        display: none !important;
    }

    .inbox-container.chat-active .chat-area,
    .admin-inbox-container.chat-active .admin-chat-area {
        display: flex !important;
    }

    /* Back Button Logic */
    .back-to-list-btn {
        display: inline-block !important; /* Show button on mobile */
        margin-right: 10px;
        background: none;
        border: none;
        font-size: 18px;
        color: var(--primary);
        cursor: pointer;
    }
}

/* Hide Back Button on Desktop */
.back-to-list-btn {
    display: none;
}

/* --- ADMIN MOBILE IMPROVEMENTS --- */

/* 1. Listings Header Layout (Desktop Default) */
.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-add-new {
    width: auto;
    padding: 10px 20px;
    margin-top: 0; /* Reset default margin */
}

/* 2. Mobile Specific Fixes */
@media (max-width: 768px) {

    /* Fix A: Stack Title and Button vertically */
    .listings-header {
        flex-direction: column;
        align-items: flex-start; /* Align left */
        gap: 15px;
    }

    .btn-add-new {
        width: 100%; /* Full width button is easier to tap */
    }

    /* Fix B: Enable Horizontal Scroll for Tables */
    .table-container {
        overflow-x: auto; /* Adds scrollbar if content is too wide */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iPhone */
        width: 100%;
        display: block; /* Ensures container behaves as a block */
    }

    .dashboard-table {
        min-width: 600px; /* Forces the table to be wide enough to show all columns */
    }

    /* Optional: Adjust padding for table cells on mobile to save space */
    .dashboard-table th, 
    .dashboard-table td {
        padding: 12px 10px; 
        font-size: 13px;
        white-space: nowrap; /* Prevents text wrapping so rows stay neat */
    }
}

/* --- NEW: VERIFIED BADGE (USER CARD) --- */
.verified-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #1A73E8; /* Solid Blue */
    color: white;
    padding: 4px 8px;
    border-radius: 50px; /* Pill shape */
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: auto; /* Pushes it to the far right of the flex container */
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.2);
}

.verified-tag i {
    font-size: 10px;
    background: white;
    color: #1A73E8;
    border-radius: 50%;
    padding: 1px;
}

/* --- NEW: CREATIVE ICON BUTTONS --- */
.filter-buttons {
    gap: 10px; /* Space between icons */
}

.btn-icon-only {
    width: 48px;  /* Fixed square width */
    height: 48px; /* Fixed square height */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px; /* Smooth corners */
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy effect */
    border: 1px solid var(--border);
    background: white;
    color: var(--secondary);
}

.btn-icon-only:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-icon-only.filled {
    background-color: var(--primary);
    color: white;
    border: none;
}

.btn-icon-only.filled:hover {
    background-color: #5d54c9;
    box-shadow: 0 4px 12px rgba(112, 101, 240, 0.3);
}

/* Mobile Adjustment for Icon Buttons */
@media (max-width: 768px) {
    .btn-icon-only {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
}

/* --- IMPROVED BACK BUTTON (Details Page) --- */

/* 1. Container alignment */
.detail-nav {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

/* 2. Button Styling (Removes the ugly box) */
.back-btn {
    background: transparent;
    border: none;
    color: var(--secondary); /* Dark Blue text */
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Space between arrow and text */
    padding: 0;
    transition: color 0.2s ease;
}

/* 3. Icon Styling */
.back-btn i {
    color: var(--primary); /* Purple Arrow */
    font-size: 14px;
    transition: transform 0.2s ease;
}

/* 4. Hover Effects */
.back-btn:hover {
    color: var(--primary); /* Text turns purple */
}

.back-btn:hover i {
    transform: translateX(-4px); /* Arrow slides slightly left */
}

/* --- FIX: FILTER MODAL STYLING --- */

/* 1. Fix the Close Button (X) */
.modal-header button {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-grey);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-header button:hover {
    background-color: #F5F6F7;
    color: var(--secondary);
}

/* 2. Fix the Bottom Action Buttons (Clear vs Apply) */
#filterForm .form-row {
    display: flex;
    gap: 15px; /* Space between the two buttons */
    margin-top: 20px;
}

#filterForm button {
    width: 50%; /* Equal width */
    height: 48px; /* FORCE exact same height */
    padding: 0; /* Remove padding triggers */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    margin: 0; /* Remove any default margins */
}

/* Specific styling for Clear to ensure it looks good */
#clearFilters {
    background-color: white;
    border: 1px solid var(--border);
    color: var(--text-grey);
}

#clearFilters:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}