/* ==========================================================================
   NAYNA DESIGN SYSTEM (นายหน้า จำนอง-ขายฝาก)
   Theme: Luxury Real Estate & Fintech Matchmaking Hub
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary: #059669;
    --primary-hover: #047857;
    --primary-dark: #064e3b;
    --primary-light: #d1fae5;
    --primary-glow: rgba(5, 150, 105, 0.25);

    --gold: #d97706;
    --gold-light: #fef3c7;
    --gold-hover: #b45309;

    --navy: #0f172a;
    --navy-card: #1e293b;
    --navy-light: #334155;

    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: #10b981;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --danger: #ef4444;
    --danger-light: #fee2e2;
    --success: #10b981;
    --info: #0284c7;

    /* Listing Type Badges */
    --badge-consignment-bg: #f3e8ff;
    --badge-consignment-text: #7e22ce;
    --badge-mortgage-bg: #ecfdf5;
    --badge-mortgage-text: #047857;
    --badge-sale-bg: #fffbeb;
    --badge-sale-text: #b45309;

    /* Elevation & Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 8px 20px -4px var(--primary-glow);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Prompt', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.font-num {
    font-family: 'Plus Jakarta Sans', 'Prompt', sans-serif;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-main {
    flex: 1;
    padding-bottom: 60px;
}

/* Navbar */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--primary-dark);
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: var(--shadow-glow);
}

.brand-tag {
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 600;
    background: var(--gold-light);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: 4px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
    box-shadow: 0 6px 16px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, #b45309 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.84rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-subtle);
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar-btn:hover {
    border-color: var(--primary);
    background: white;
}

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

.user-name-tag {
    font-size: 0.88rem;
    font-weight: 600;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Notification Bell */
.notif-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
}

.notif-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
    color: white;
    padding: 64px 0 54px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    pointer-events: none;
}

.hero-content {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: #a7f3d0;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-title span {
    background: linear-gradient(135deg, #34d399 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 32px;
    line-height: 1.7;
}

/* Search Bar Box */
.search-box-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-xl);
    margin-top: 24px;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr auto;
    gap: 12px;
    align-items: center;
}

.search-input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 6px 12px;
    border-right: 1px solid var(--border);
}

.search-input-group:last-of-type {
    border-right: none;
}

.search-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.search-field {
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    background: transparent;
    font-family: inherit;
    width: 100%;
}

/* Property Cards Grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.property-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.property-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    background: #e2e8f0;
    overflow: hidden;
}

.property-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.property-card:hover .property-thumbnail {
    transform: scale(1.05);
}

.badge-listing-type {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
    z-index: 2;
}

.badge-consignment {
    background: rgba(126, 34, 206, 0.9);
    color: white;
}

.badge-mortgage {
    background: rgba(5, 150, 105, 0.9);
    color: white;
}

.badge-sale {
    background: rgba(217, 119, 6, 0.9);
    color: white;
}

.badge-status {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.75);
    color: white;
    backdrop-filter: blur(4px);
}

.btn-card-like {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    z-index: 2;
}

.btn-card-like:hover, .btn-card-like.liked {
    color: #ef4444;
    background: white;
    transform: scale(1.1);
}

.property-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.property-location {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.property-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.financial-metric-row {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.metric-interest {
    color: var(--gold);
}

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

.broker-mini-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.broker-name-mini {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-counters {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Detail Page Specific */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    margin-top: 32px;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-box {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.gallery-main-img {
    width: 100%;
    height: 440px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    margin-bottom: 12px;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.gallery-thumb-item {
    width: 90px;
    height: 70px;
    border-radius: var(--radius-md);
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: var(--transition);
}

.gallery-thumb-item.active, .gallery-thumb-item:hover {
    border-color: var(--primary);
    opacity: 1;
}

/* Financial Highlights Card */
.fin-summary-box {
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 24px;
}

.fin-big-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #34d399;
}

.fin-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.fin-spec-col {
    display: flex;
    flex-direction: column;
}

.fin-spec-title {
    font-size: 0.75rem;
    color: #94a3b8;
}

.fin-spec-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

/* Comments Section */
.comment-box {
    margin-top: 24px;
}

.comment-input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.comment-textarea {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    resize: vertical;
    min-height: 80px;
}

.comment-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

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

.comment-body {
    flex: 1;
}

.comment-author-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 700;
    font-size: 0.92rem;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    white-space: pre-line;
}

/* Toast Alerts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.toast-error {
    border-left-color: var(--danger);
}

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

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 99;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 992px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .search-box-card {
        grid-template-columns: 1fr 1fr;
    }
    .search-input-group:nth-child(2) {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .mobile-nav {
        display: flex;
    }
    .site-main {
        padding-bottom: 80px;
    }
    .hero-title {
        font-size: 1.85rem;
    }
    .search-box-card {
        grid-template-columns: 1fr;
    }
    .search-input-group {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .gallery-main-img {
        height: 280px;
    }
}
