/* EstateBridge App - Responsive Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0057ff;
    --primary-dark: #0037a6;
    --primary-light: #eaf2ff;
    --dark-slate: #090e1a;
    --sidebar-bg: #07111f;
    --sidebar-panel: rgba(255, 255, 255, 0.08);
    --sidebar-panel-border: rgba(255, 255, 255, 0.12);
    --sidebar-text: #94a3b8;
    --sidebar-text-strong: #e2e8f0;
    --sidebar-active: rgba(0, 87, 255, 0.18);
    --danger-soft: rgba(239, 68, 68, 0.12);
    --bg-light: #f1f5f9;
    --bg-card: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #475569;
    --border-light: rgba(0, 87, 255, 0.08);
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --sidebar-width: 300px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.01);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif !important;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    /* Standard fix for all horizontal scroll issues */
    background-color: var(--bg-light);
    color: var(--text-dark);
}

body {
    display: flex;
    min-height: 100vh;
    padding-bottom: 75px;
    /* Generous breathing space for mobile nav */
}

@media (min-width: 769px) {
    body {
        padding-bottom: 0;
    }
}

/* ==========================================================================
   MOBILE TOP PERSISTENT STICKY HEADER
   ========================================================================== */
.mobile-app-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    z-index: 998;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.mobile-hamburger-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-app-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark);
}

.mobile-app-brand-logo {
    width: 108px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    display: block;
}

/* ==========================================================================
   SIDEBAR (DESKTOP)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background:
        radial-gradient(circle at top left, rgba(0, 87, 255, 0.34), transparent 34%),
        linear-gradient(180deg, var(--sidebar-bg) 0%, #07111f 58%, #050a13 100%);
    color: var(--sidebar-text);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    overflow-x: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 18px 0 55px rgba(2, 6, 23, 0.28);
}

.sidebar-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 16px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    margin-bottom: 24px;
    padding: 16px 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .logo-icon {
    width: 80px;
    height: auto;
    border-radius: 30px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: none;
    overflow: visible;
    padding: 0;
    box-sizing: border-box;
}

.sidebar-brand .logo-icon img {
    width: 100%;
    border-radius: 30px;
    height: auto;
    object-fit: contain;
    display: block;
}

.sidebar-brand .logo-accent {
    color: var(--primary);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
}

.brand-copy small {
    color: #7dd3fc;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* User Profile Block */
.sidebar-user {
    background: linear-gradient(135deg, var(--sidebar-panel), rgba(255, 255, 255, 0.055));
    border: 1px solid var(--sidebar-panel-border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 22px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #38bdf8, var(--primary));
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(0, 87, 255, 0.28);
}

.user-meta h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    word-break: break-word;
}

.user-role-badge {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
    background-color: rgba(0, 87, 255, 0.18);
    color: #93c5fd;
    padding: 3px 9px;
    border-radius: 50px;
    border: 1px solid rgba(59, 130, 246, 0.22);
}

/* Side Navigation list */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex-grow: 1;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
}

.sidebar-section-title {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-left: 4px;
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sidebar-text-strong);
    text-decoration: none;
    transition: var(--transition);
}

.menu-item i {
    font-size: 18px;
    color: var(--sidebar-text);
    transition: var(--transition);
}

.menu-text {
    white-space: nowrap;
}

.menu-badge {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.menu-badge.verified {
    background: rgba(16, 185, 129, 0.14);
    color: #86efac;
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.menu-badge.pending {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(4px);
}

.menu-item.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-close {
    display: none;
}

/* Sidebar overlay background */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(2, 6, 23, 0.48);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: none;
    /* Desktop hidden */
    justify-content: space-around;
    align-items: center;
    z-index: 997;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.03);
    padding: 0 10px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    flex: 1;
    transition: var(--transition);
}

.bottom-nav-item i {
    font-size: 20px;
    transition: var(--transition);
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active i {
    transform: translateY(-2px);
}

/* ==========================================================================
   MAIN WORKSPACE AREA
   ========================================================================== */
.main-workspace {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 40px;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    gap: 16px;
}

.header-welcome h2 {
    font-size: 28px;
    font-weight: 800;
}

.header-welcome p {
    font-size: 14px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 16px;
}

.btn-post,
.btn-back {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.btn-back {
    background-color: var(--bg-card);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.btn-back:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Portal Grid and Card Layouts */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    width: 100%;
}

.item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.item-media {
    position: relative;
    height: 180px;
}

.item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-trust-indicators {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
}

.trust-badge {
    background-color: rgba(16, 185, 129, 0.95);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 50px;
}

.item-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.item-location {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.item-price {
    font-size: 18px;
    color: var(--primary-dark);
    font-weight: 800;
    margin-bottom: 16px;
}

.item-cta-row {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-item-action {
    flex-grow: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-item-action.primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-item-action.secondary {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

/* Account Center Layout styling */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
}

.profile-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    padding: 12px 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background-color: var(--bg-light);
    font-size: 13.5px;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    background-color: #fff;
    border-color: var(--primary);
}

.btn-save-profile {
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 14px;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-save-profile:hover {
    background-color: var(--primary-dark);
}

/* ==========================================================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* Slide sidebar in/out on mobile view */
    .sidebar {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        z-index: 1000;
        transform: translateX(-105%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease, visibility 0.24s ease;
    }

    .sidebar.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-overlay {
        display: block;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.24s ease, visibility 0.24s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Make Workspace expand completely */
    .main-workspace {
        margin-left: 0;
        width: 100%;
        padding: 80px 16px 80px 16px;
        /* Offset for Mobile top header and bottom nav */
    }

    /* Enable Mobile Persistent Top Header */
    .mobile-app-header {
        display: flex;
    }

    /* Enable Mobile Navigation */
    .mobile-bottom-nav {
        display: flex;
    }

    .workspace-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }
}