/* ==========================================================================
   FIRSTDREAM UNIFIED PORTAL FRAME DESIGN SYSTEM (Desktop & Mobile)
   ========================================================================== */

:root {
    --brand-dark: #0a1520;
    --brand-surface: #0d233a;
    --brand-primary: #0284c7;
    --brand-accent: #3b82f6;
    --brand-gold: #f59e0b;
    --brand-yellow: #f2c931;
    --brand-green: #22c55e;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border-light: #e2e8f0;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px -3px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 35px -4px rgba(15, 23, 42, 0.12);
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--brand-dark) !important;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    height: 100% !important;
    overflow: hidden !important;
}

/* ==========================================================================
   HEADER NAVIGATION (Unified Glass Nav: re-99-header)
   ========================================================================== */
header.re-99-header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25) !important;
    background: #0a1520 !important;
    z-index: 10000 !important;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    height: 60px !important;
}

.header-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo-row button.nav-hamburger-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    outline: none;
    padding: 0;
    margin: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.header-logo-row button.nav-hamburger-btn:hover {
    color: var(--brand-yellow);
    transform: scale(1.08);
}

.header-logo-row img.header-brand-logo {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
}

.header-team-brand {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-team-brand:hover {
    opacity: 0.95;
    transform: scale(1.02);
}

.header-brand-title {
    display: inline-flex;
    align-items: center;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
    padding-left: 10px;
    margin-left: 4px;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.2px;
}

.brand-first {
    color: #ffffff;
    font-weight: 800;
}

.brand-team-badge {
    background: var(--brand-yellow);
    color: #0a1520;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 6px;
    margin-left: 4px;
    letter-spacing: 0.2px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(242, 201, 49, 0.35);
}

.header-links-center {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-links-center a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.header-links-center a:hover {
    color: #ffffff;
}

.header-actions-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-post-property {
    background: #22c55e;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 30px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.22);
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-post-property:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.btn-post-property span {
    background: #ffffff;
    color: #22c55e;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.btn-signin-nav {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s, transform 0.2s;
    text-decoration: none;
}

.btn-signin-nav:hover {
    background: #ffffff;
    color: #0a1520;
    transform: scale(1.05);
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   DESKTOP MAIN CONTAINER (Card Frame on All Sides)
   ========================================================================= */
.desktop-main-container {
    background: #ffffff !important;
    box-sizing: border-box !important;
    position: relative;
}

@media (min-width: 769px) {
    .desktop-main-container {
        position: fixed !important;
        top: 76px !important;
        bottom: 16px !important;
        left: 16px !important;
        right: 16px !important;
        width: calc(100% - 32px) !important;
        max-width: 100% !important;
        height: calc(100vh - 92px) !important;
        height: calc(100dvh - 92px) !important;
        margin: 0 auto !important;
        padding: 32px 36px 40px !important;
        border-radius: 20px !important;
        box-shadow: 0 12px 42px rgba(0, 0, 0, 0.35) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 100 !important;
    }

    .desktop-main-container::-webkit-scrollbar {
        width: 8px;
    }
    .desktop-main-container::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 8px;
    }
    .desktop-main-container::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 8px;
    }
    .desktop-main-container::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
}

@media (max-width: 768px) {
    header.re-99-header {
        padding: 6px 14px !important;
        height: 56px !important;
    }

    .header-logo-row img.header-brand-logo {
        height: 38px !important;
    }

    .header-brand-title {
        font-size: 1rem;
        padding-left: 8px;
    }

    .header-links-center,
    .btn-post-property {
        display: none !important;
    }

    .desktop-main-container {
        position: fixed !important;
        top: 64px !important;
        bottom: 68px !important;
        left: 8px !important;
        right: 8px !important;
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
        height: calc(100vh - 132px) !important;
        height: calc(100dvh - 132px) !important;
        margin: 0 auto !important;
        padding: 20px 14px 28px !important;
        border-radius: 18px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 100 !important;
        background: #ffffff !important;
    }
}

/* ==========================================================================
   PORTAL FOOTER
   ========================================================================== */
footer,
footer.portal-footer,
.desktop-main-container footer {
    background: transparent !important;
    background-color: transparent !important;
    color: #64748b !important;
    margin: 36px auto 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 36px 20px 24px !important;
}

footer.portal-footer a,
.desktop-main-container footer a {
    color: #475569 !important;
}

footer.portal-footer a:hover,
.desktop-main-container footer a:hover {
    color: var(--brand-primary) !important;
}

.footer-content-wrap {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.footer-nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    font-weight: 600;
    font-size: 0.88rem;
}

.footer-nav-links a {
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav-links a:hover {
    color: var(--brand-primary);
}

.footer-app-badges {
    display: flex;
    gap: 14px;
    align-items: center;
}

.footer-app-badges img {
    height: 38px;
    width: auto;
    transition: transform 0.2s;
}

.footer-app-badges img:hover {
    transform: translateY(-2px);
}

.footer-social-row {
    display: flex;
    gap: 14px;
}

.footer-social-row a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
}

.footer-social-row a:hover {
    background: #e2e8f0;
    color: var(--brand-primary);
    transform: translateY(-2px);
}

.footer-copyright {
    margin: 0;
    line-height: 1.6;
    color: #94a3b8;
    font-size: 0.84rem;
}

/* ==========================================================================
   DIRECT PRELOADER
   ========================================================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a1520;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.preloader-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.preloader-dots {
    display: flex;
    gap: 8px;
}

.preloader-dots .dot-item {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    animation: dotPulse 1.2s infinite ease-in-out;
}

.preloader-dots .dot-item:nth-child(1) { background-color: #0284c7; animation-delay: 0s; }
.preloader-dots .dot-item:nth-child(2) { background-color: #f59e0b; animation-delay: 0.2s; }
.preloader-dots .dot-item:nth-child(3) { background-color: #22c55e; animation-delay: 0.4s; }
.preloader-dots .dot-item:nth-child(4) { background-color: #ef4444; animation-delay: 0.6s; }

@keyframes dotPulse {
    0%, 100% { transform: scale(0.6); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* Floating Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0a1520;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
}

.back-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top-btn:hover {
    background: var(--brand-primary);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 74px;
        right: 16px;
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
}
