/* --- "Vision 2026" Post Property UI --- */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800&display=swap');

:root {
    --brand-red: #e81123;
    --brand-dark: #000914;
    --surface: #ffffff;
    --bg-main: #f4f7fa;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-soft: #e2e8f0;
    --radius-lg: 24px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.02), 0 5px 10px rgba(0, 0, 0, 0.01);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lexend', sans-serif;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

.post-property-main {
    min-height: 100vh;
    padding-bottom: 5rem;
}

/* --- Immersive Header Section --- */
.page-hero-header {
    background: var(--brand-dark);
    color: white;
    padding: 4rem 2rem 8rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, var(--bg-main), transparent);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Floating Architecture --- */
.post-property-wrapper {
    max-width: 1100px;
    margin: -5rem auto 0;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
}

/* --- Left Navbar (Vertical Stealth) --- */
.stealth-nav {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
    position: sticky;
    top: 90px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-muted);
}

.nav-item .icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.nav-item.active {
    background: #fffafa;
    color: var(--brand-red);
}

.nav-item.active .icon-box {
    background: var(--brand-red);
    color: white;
}

.nav-item.completed .icon-box {
    background: #10b981;
    color: white;
}

/* Builder nav items — same style as nav-item */
.b-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    cursor: pointer;
    color: var(--text-muted);
}

.b-nav-item .icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.b-nav-item.active {
    background: #fffafa;
    color: var(--brand-red);
}

.b-nav-item.active .icon-box {
    background: var(--brand-red);
    color: white;
}

/* Banker nav items — same style */
.bk-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    cursor: pointer;
    color: var(--text-muted);
}
.bk-nav-item .icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.bk-nav-item.active { background: #fffafa; color: var(--brand-red); }
.bk-nav-item.active .icon-box { background: var(--brand-red); color: white; }

.nav-text {
    font-size: 0.9rem;
    font-weight: 600;
}

/* --- Score Widget (Integrated) --- */
.score-widget {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #0f172a;
    border-radius: 20px;
    color: white;
    position: relative;
}

.score-v-line {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    display: block;
    margin-bottom: 0.5rem;
}

.score-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.score-number {
    font-size: 2rem;
    font-weight: 800;
}

.score-progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.score-progress-bar {
    height: 100%;
    background: var(--brand-red);
    width: 0%;
    transition: width 0.8s ease;
}

/* --- Main Form Card --- */
.post-content-area {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
    min-height: 600px;
}

.step-form {
    display: none;
    animation: fadeInSlide 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.step-form.active {
    display: block;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Modern Controls --- */
.section-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 2rem;
    display: block;
}

.pill-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

/* --- Classic Radio Style --- */
.radio-classic-group {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    color: #1e293b;
    font-size: 1.05rem;
    padding: 0.5rem 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.radio-item input[type="radio"] {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin: 0;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-item input[type="radio"]:checked {
    border-color: #e81123;
}

.radio-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #e81123;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pill-btn {
    padding: 0.5rem 1.25rem;
    border: 1.5px solid #eef2f6;
    border-radius: 50px;
    background: #ffffff;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pill-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

input:checked+.pill-btn {
    background: #fff5f5;
    /* Very light red tint */
    border-color: #e81123;
    color: #e81123;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(232, 17, 35, 0.05);
}

/* Specific styling for category tabs */
.pill-group.category-tabs {
    justify-content: center;
    margin-bottom: 2rem;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 16px;
    display: inline-flex;
    width: auto;
    min-width: 300px;
}

.pill-group.category-tabs .pill-btn {
    flex: 1;
    border: none;
    background: transparent;
    font-weight: 600;
    transition: all 0.3s;
}

input[name="property_cat"]:checked+.pill-btn {
    background: var(--brand-red) !important;
    color: white !important;
    border-color: var(--brand-red) !important;
    box-shadow: 0 4px 15px rgba(232, 17, 35, 0.2);
    border-radius: 12px;
}

.form-input-premium {
    width: 100%;
    padding: 0.8rem 1.25rem;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 1.05rem;
    transition: all 0.3s;
}

.form-input-premium:focus {
    background: white;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 4px rgba(232, 17, 35, 0.05);
}

.btn-primary {
    background: var(--brand-red);
    color: white;
    padding: 0.9rem 2.5rem;
    font-weight: 800;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(232, 17, 35, 0.2);
    transition: all 0.3s;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 2rem;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.btn-back:hover {
    color: var(--brand-red);
    transform: translateX(-5px);
}

/* --- Complex Field Dashboard UI --- */
.dashboard-card {
    background: white;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.area-field-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.area-input-wrapper-premium {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: 14px;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
}

.area-input-wrapper-premium:focus-within {
    border-color: var(--brand-red);
    background: white;
}

.area-content {
    flex: 1;
}

.area-label-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.area-field-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin-top: 2px;
}

.area-field-input:focus {
    outline: none;
}

.area-unit-select {
    background: transparent;
    border: none;
    font-weight: 700;
    color: var(--brand-red);
    cursor: pointer;
    font-size: 0.9rem;
}

.sub-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.pill-group.numbers .pill-btn {
    min-width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.blue-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.blue-link:hover {
    text-decoration: underline;
}


/* --- Suggestions Dropdown Styling --- */
.form-section {
    position: relative;
    margin-bottom: 2rem;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 2px;
}

.suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}

.suggestions-dropdown::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 0 12px 12px 0;
}

.suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.suggestion-item {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    color: #1e293b;
    border-bottom: 1px solid #f8fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8fafc;
    color: #e81123;
}

/* --- Mobile Fixes --- */
@media (max-width: 900px) {

    /* Hero header — reduce bottom padding so overlap is manageable */
    .page-hero-header {
        padding: 1.5rem 1rem 3.5rem;
    }

    .page-hero-header::after {
        height: 60px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    /* Wrapper: single column, small negative pull, no horizontal overflow */
    .post-property-wrapper {
        grid-template-columns: 1fr;
        margin: -2rem auto 0;
        padding: 0 0.75rem;
        gap: 0.75rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Stealth nav: horizontal scrollable step bar */
    .stealth-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem 0.5rem;
        gap: 0.3rem;
        border-radius: 14px;
        position: static;
        scrollbar-width: none;
        -ms-overflow-style: none;
        align-items: center;
    }

    .stealth-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        flex-direction: column;
        align-items: center;
        min-width: 58px;
        max-width: 68px;
        padding: 0.45rem 0.3rem;
        border-radius: 10px;
        gap: 0.25rem;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    /* Hide the nav-info wrapper text on very small screens, show only icon */
    .nav-item .nav-info {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-item .icon-box {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        font-size: 0.7rem;
    }

    .b-nav-item, .bk-nav-item {
        flex-direction: column;
        align-items: center;
        min-width: 58px;
        max-width: 68px;
        padding: 0.45rem 0.3rem;
        border-radius: 10px;
        gap: 0.25rem;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .b-nav-item .nav-info, .bk-nav-item .nav-info {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .b-nav-item .icon-box, .bk-nav-item .icon-box {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        font-size: 0.7rem;
    }

    .nav-text {
        font-size: 0.6rem;
        text-align: center;
        line-height: 1.2;
        white-space: normal;
        word-break: break-word;
        max-width: 60px;
    }

    /* Hide score widget on mobile */
    .score-widget {
        display: none;
    }

    /* Main form area */
    .post-content-area {
        padding: 1.25rem 0.9rem;
        border-radius: 16px;
        min-height: unset;
    }

    .welcome-msg {
        font-size: 1.15rem;
        margin-bottom: 1rem;
    }

    .section-label {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* Pill groups */
    .pill-group {
        gap: 0.4rem;
        margin-bottom: 1.25rem;
        flex-wrap: wrap;
    }

    .pill-btn {
        padding: 0.38rem 0.8rem;
        font-size: 0.8rem;
    }

    .pill-group.numbers .pill-btn {
        min-width: 40px;
        height: 40px;
        border-radius: 10px;
        padding: 0;
        font-size: 0.85rem;
    }

    /* Category tabs full width on mobile */
    .pill-group.category-tabs {
        width: 100%;
        min-width: unset;
        display: flex;
    }

    /* Radio group wraps */
    .radio-classic-group {
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-bottom: 1.25rem;
    }

    .radio-item {
        font-size: 0.88rem;
    }

    /* Area fields: single column */
    .area-field-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Contact / floor grid: single column */
    .floor-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Form inputs */
    .form-input-premium {
        font-size: 0.92rem;
        padding: 0.65rem 0.9rem;
    }

    /* Back button */
    .btn-back {
        font-size: 0.82rem;
        margin-bottom: 1rem;
    }

    /* Primary button full width */
    .btn.btn-primary.next-step,
    #finishPosting {
        width: 100%;
        padding: 0.85rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }

    /* Map height reduce */
    #propertyMap {
        height: 200px !important;
    }

    /* Dashboard card padding */
    .dashboard-card {
        padding: 1rem;
        border-radius: 14px;
    }

    /* Upload dropzone */
    .dropzone-area {
        padding: 1.25rem 0.75rem;
    }

    /* Form section spacing */
    .form-section {
        margin-bottom: 1.1rem;
    }

    /* Sub label */
    .sub-label {
        font-size: 0.82rem;
    }

    /* Sub section spacing */
    .sub-section {
        margin-top: 0.9rem !important;
    }

    /* Map card padding */
    .dashboard-map-card > div:first-child {
        padding: 1rem !important;
    }

    .dashboard-map-card > div:last-child {
        padding: 1rem !important;
    }

    /* Location pick button stays compact */
    #pickLocationBtn {
        padding: 0 1rem !important;
        font-size: 0.85rem !important;
    }

    /* Terms box */
    .form-section[style*="background: #fdf2f2"] {
        padding: 1rem !important;
    }
}

/* --- Extra small screens (< 400px) --- */
@media (max-width: 400px) {
    .post-property-wrapper {
        padding: 0 0.5rem;
    }

    .post-content-area {
        padding: 1rem 0.75rem;
    }

    .hero-title {
        font-size: 1.2rem;
    }

    .nav-item {
        min-width: 50px;
        max-width: 58px;
    }

    .b-nav-item {
        min-width: 50px;
        max-width: 58px;
    }

    .nav-text {
        font-size: 0.55rem;
    }

    .pill-btn {
        padding: 0.32rem 0.65rem;
        font-size: 0.75rem;
    }

    .pill-group.numbers .pill-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}
