@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --bg-dark: #F4F2EA; /* Warm parchment cream */
    --bg-card: #FFFFFF; /* Pure white cards */
    --bg-card-hover: #FAF9F6;
    --primary: #C5A358; /* Premium Gold/Tan accent */
    --primary-hover: #B08F47;
    --primary-glow: rgba(197, 163, 88, 0.05);
    --secondary: #143D2A; /* Royal deep forest/olive green */
    --secondary-hover: #0F2D1F;
    --text-main: #1C2A20; /* Dark forest/espresso charcoal */
    --text-muted: #5A675D; /* Sophisticated sage gray */
    --border: rgba(20, 61, 42, 0.09); /* Subtle green-toned borders */
    --border-hover: rgba(20, 61, 42, 0.18);
    --success: #143D2A; /* Rich olive success green */
    
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

::placeholder {
    color: #8E95A5 !important;
    opacity: 0.85;
}

::-webkit-input-placeholder {
    color: #8E95A5 !important;
    opacity: 0.85;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Three.js Canvas Container */
#three-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.15; /* Subtler in light mode to keep text highly readable */
}

/* Header & Navigation - Royal Dark Green Theme */
header {
    background: var(--secondary); /* Solid rich deep green */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1340px;
    margin: 0 auto;
    padding: 0.9rem 2.5rem; /* Slightly tighter padding like screenshot */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-brand {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.logo-pill {
    background: #FFFFFF;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.25s ease;
}

.logo-pill img {
    height: 24px;
    width: auto;
    display: block;
    margin-right: 0.4rem;
}

.logo-text-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: #143D2A;
    letter-spacing: 0.02em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.logo-text-title .gold-text {
    color: var(--primary);
}

.logo-text-title .tld-text {
    font-size: 0.75rem;
    font-weight: 400;
    color: #888882;
}

.logo-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

@media (min-width: 576px) {
    .logo-pill {
        padding: 0.35rem 1rem;
        height: 44px;
    }
    .logo-pill img {
        height: 28px;
        margin-right: 0.5rem;
    }
    .logo-text-title {
        font-size: 1.15rem;
    }
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important; /* Gold on active/hover */
}

/* Header-specific Broker Login button overrides to ensure dark text on gold button */
header .btn-primary {
    background: var(--primary) !important;
    color: var(--secondary) !important; /* Dark green text */
    box-shadow: none !important;
}

header .btn-primary:hover {
    background: var(--primary-hover) !important;
    color: var(--secondary) !important;
}

/* Ensure mobile menu toggle matches the white theme */
.nav-toggle {
    color: #FFFFFF !important;
}

/* Clean Editorial Buttons */
.btn {
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(155, 126, 88, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(155, 126, 88, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--border-hover);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Section Styling */
.grid-container {
    max-width: 1340px;
    margin: 0 auto;
    padding: 5rem 2.5rem;
}

.section-num {
    display: block;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-style: italic;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.section-title {
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.section-title h2 {
    font-size: 2.25rem;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.section-title h2 span {
    font-family: var(--font-serif);
    font-style: italic;
}

/* Hero Section - Editorial Offset Layout */
.hero-wrapper {
    max-width: 1340px;
    margin: 0 auto;
    padding: 6rem 2.5rem 4rem;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    text-align: left;
}

.hero-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero-content h1 {
    font-size: 3.75rem;
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 1.75rem;
    color: var(--text-main);
}

.hero-content h1 span {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}

.hero-content p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 580px;
    line-height: 1.7;
}

/* Clean Integrated Search Bar */
.search-container-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.search-bar {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 1.25rem;
    align-items: center;
}

.search-field {
    display: flex;
    flex-direction: column;
    text-align: left;
    border-right: 1px solid var(--border);
    padding-right: 1.25rem;
}

.search-field:last-of-type {
    border-right: none;
    padding-right: 0;
}

.search-field label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.search-field input, .search-field select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
}

.search-field select option {
    background: var(--bg-card);
    color: var(--text-main);
}

/* Clean Cards Grid */
.brokers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2.5rem;
}

.broker-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
}

.broker-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

.broker-card.featured-card {
    border-color: rgba(155, 126, 88, 0.25);
    background: linear-gradient(180deg, #FFFFFF 0%, #FAF9F6 100%);
}

.featured-ribbon {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
}

.broker-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.broker-header h3 {
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 0.35rem;
}

.city-tag {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot-container {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    position: absolute;
    top: 2.5rem;
    right: 2.5rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.active {
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success);
}

/* Trust Badges - Clean Non-Intrusive Tags */
.badge-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.badge-item {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.02);
    color: var(--text-muted);
}

.badge-rera {
    border-color: rgba(155, 126, 88, 0.3);
    color: var(--primary);
    background: rgba(155, 126, 88, 0.03);
}

.badge-expert {
    border-color: rgba(74, 99, 124, 0.3);
    color: var(--secondary);
    background: rgba(74, 99, 124, 0.03);
}

.badge-responder {
    border-color: rgba(40, 96, 60, 0.3);
    color: var(--success);
    background: rgba(40, 96, 60, 0.03);
}

.broker-details-list {
    list-style: none;
    margin-bottom: 2rem;
}

.broker-details-list li {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.broker-details-list li i {
    margin-top: 0.25rem;
}

.broker-details-list strong {
    color: var(--text-main);
    font-weight: 500;
}

.broker-action {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

/* Glass panel */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

/* Clean Floating AI Chatbot */
#chatbot-container {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 500;
}

.chatbot-bubble {
    width: 54px;
    height: 54px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 1.35rem;
    color: #FFFFFF;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-bubble:hover {
    transform: scale(1.05) rotate(5deg);
}

.chatbot-box {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 370px;
    height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

.chatbot-box.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chat-header {
    background: rgba(0,0,0,0.01);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    font-size: 0.95rem;
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.chat-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.45;
}

.chat-message.ai {
    background: rgba(0,0,0,0.02);
    align-self: flex-start;
    color: var(--text-main);
    border-bottom-left-radius: 0;
    border: 1px solid var(--border);
}

.chat-message.user {
    background: var(--primary);
    color: #FFFFFF;
    align-self: flex-end;
    border-bottom-right-radius: 0;
    font-weight: 500;
}

.chat-input-area {
    border-top: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    background: rgba(0,0,0,0.01);
}

.chat-input {
    flex: 1;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    color: var(--text-main);
    font-size: 0.875rem;
    outline: none;
}

.chat-send {
    background: var(--primary);
    border: none;
    color: #FFFFFF;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 11, 14, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    width: 100%;
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 20px 45px rgba(0,0,0,0.12);
    transform: translateY(15px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1.15rem;
    color: var(--text-main);
    outline: none;
    font-size: 0.95rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.01);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #FFFFFF;
}

/* Analytics Stats Bar */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    text-align: left;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.01);
}

.stat-val {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.stat-lbl {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

/* Responsive Fixes */
@media(max-width: 992px) {
    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding-top: 4rem;
    }
    .search-bar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .search-field {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 0.75rem;
    }
    .search-field:last-of-type {
        border-bottom: none;
        padding-bottom: 0;
    }
}

.save-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    gap: 0.4rem;
}

.save-btn:hover, .save-btn.active {
    color: #E74C3C;
    border-color: rgba(231, 76, 60, 0.3);
    background: rgba(231, 76, 60, 0.02);
}

@media(max-width: 768px) {
    .hero-content h1 {
        font-size: 2.75rem;
    }
    .grid-container {
        padding: 4rem 1.5rem;
    }
    .nav-container {
        padding: 1rem 1.5rem;
    }
    .nav-menu {
        display: none;
    }
    .brokers-grid {
        grid-template-columns: 1fr;
    }
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Toast system styles */
.toast {
    background: #FFFFFF;
    border: 1px solid var(--primary);
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideInGlobal 0.3s ease forwards;
    min-width: 250px;
    pointer-events: auto;
}

.toast-error {
    border-color: #E74C3C;
}

@keyframes slideInGlobal {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Global Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
}
.nav-toggle:hover {
    color: var(--primary);
}

/* Global Responsive Auth Card */
.auth-card {
    max-width: 460px;
    margin: 4rem auto;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    background: #ffffff;
    border: 1px solid var(--border);
}

@media(max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(246, 245, 242, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding: 1.5rem;
        gap: 1.25rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
        align-items: stretch;
        z-index: 999;
    }
    
    .nav-menu.mobile-open {
        display: flex;
    }
    
    .nav-menu .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .auth-card {
        margin: 1.5rem auto !important;
        padding: 2rem 1.5rem !important;
    }
    
    /* Broker Profile Responsive Fixes */
    .broker-header-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 1.5rem !important;
    }
    .broker-contact-col {
        border-left: none !important;
        border-top: 1px solid var(--border) !important;
        padding-left: 0 !important;
        padding-top: 1.5rem !important;
    }
    
    /* Card updates for mobile readability */
    .broker-card {
        padding: 1.5rem !important;
    }
    .broker-card .status-dot-container {
        position: static !important;
        margin-top: 0.5rem;
        width: fit-content;
    }
    .section-title {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        margin-bottom: 2rem !important;
        padding-bottom: 1rem !important;
    }
    .section-title h2 {
        font-size: 1.75rem !important;
    }
    .section-title span {
        font-size: 0.8rem !important;
    }
}

/* Chatbot Mobile Responsiveness */
@media (max-width: 480px) {
    #chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }
    .chatbot-box {
        bottom: 65px;
        right: 0;
        width: calc(100vw - 2rem);
        height: 450px;
        max-height: 75vh;
    }
}
