/* ==========================================
   JOURNI TRADEMART & COMMUNITY PLATFORM STYLES
   ========================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f4f6f8;
    font-family: 'Poppins', sans-serif;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
}

.jt_trademart_wrapper {
    padding: 30px 20px 60px 20px;
    min-height: 100vh;
}

.jt_trademart_container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

/* ==========================================
   LEFT SIDE (40% Communities)
   ========================================== */
.jt_tm_communities {
    flex: 0 0 40%;
    max-width: 40%;
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf0f2;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

/* Custom Scrollbar */
.jt_tm_communities::-webkit-scrollbar {
    width: 6px;
}
.jt_tm_communities::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 6px;
}

.jt_tm_comm_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.jt_tm_comm_header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.jt_tm_comm_count {
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Communities Search Bar */
.jt_tm_search_bar {
    display: flex;
    align-items: center;
    background: #f0f2f5;
    border-radius: 50px;
    padding: 8px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.jt_tm_search_bar:focus-within {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.08);
}

.jt_tm_search_bar .search-icon {
    color: #888888;
    font-size: 14px;
}

.jt_tm_search_bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    color: #000000;
}

.jt_tm_platform_pills {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.jt_platform_pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.jt_platform_pill:hover,
.jt_platform_pill.active {
    background: #b22222;
    border-color: #b22222;
    color: #ffffff;
}

/* Community Group Lists */
.jt_tm_group_section {
    margin-bottom: 24px;
}

.jt_tm_section_head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.jt_tm_section_head h3 {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jt_tm_section_head a {
    color: #b22222;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.jt_tm_section_head a:hover {
    text-decoration: underline;
}

.jt_tm_group_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jt_tm_group_item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    background: #ffffff;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.jt_tm_group_item:hover {
    background: #fafafa;
    border-color: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.jt_group_avatar_wrap {
    position: relative;
    flex-shrink: 0;
}

.jt_tm_group_item img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}

/* Small Platform Overlay on Avatar */
.jt_platform_mini_badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.jt_tm_group_info {
    flex: 1;
    min-width: 0;
}

.jt_tm_group_info h4 {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jt_group_meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.jt_group_dest {
    font-size: 11.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jt_group_dest i {
    color: #b22222;
    font-size: 10px;
}

.jt_group_platform_tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 2px;
    align-self: flex-start;
}

.jt_group_link_btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.jt_tm_group_item:hover .jt_group_link_btn {
    background: #b22222;
    color: #ffffff;
}

/* Platform-Specific Color Accents */
.jt-platform-whatsapp {
    background: #e8f8ed;
    color: #128c7e;
}
.jt-platform-whatsapp-bg {
    background: #25D366;
}

.jt-platform-insta {
    background: #fdf2f8;
    color: #be185d;
}
.jt-platform-insta-bg {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.jt-platform-telegram {
    background: #eff6ff;
    color: #0284c7;
}
.jt-platform-telegram-bg {
    background: #229ED9;
}

.jt-platform-facebook {
    background: #eff6ff;
    color: #1d4ed8;
}
.jt-platform-facebook-bg {
    background: #1877F2;
}

.jt-platform-other {
    background: #f1f5f9;
    color: #475569;
}
.jt-platform-other-bg {
    background: #64748b;
}


/* ==========================================
   RIGHT SIDE (60% Agent Deals Feed)
   ========================================== */
.jt_tm_feed {
    flex: 0 0 calc(60% - 28px);
    max-width: calc(60% - 28px);
    display: flex;
    flex-direction: column;
}

.jt_tm_feed_header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.jt_tm_feed_header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.jt_tm_feed_header span {
    font-weight: 400;
    color: #64748b;
    font-size: 15px;
}

/* Feed Filters */
.jt_tm_feed_filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.jt_tm_search_input {
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.jt_tm_search_input:focus-within {
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.08);
}

.jt_tm_search_input i {
    color: #888888;
    margin-right: 10px;
}

.jt_tm_search_input input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-size: 13.5px;
    color: #1a1a1a;
}

.jt_tm_search_select select {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 13.5px;
    color: #1a1a1a;
    outline: none;
    cursor: pointer;
    height: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: border-color 0.2s;
}

.jt_tm_search_select select:focus {
    border-color: #cbd5e1;
}

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

/* --- Expandable Vertical Cards --- */
.jt_vcard {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #eef0f2;
    transition: box-shadow 0.3s ease, border-color 0.2s ease;
}

.jt_vcard:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}

/* With-Image Header */
.jt_vcard_header {
    position: relative;
    padding: 8px 8px 0 8px; 
    cursor: pointer;
}

.jt_vcard_header img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.jt_vcard_overlay {
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    padding: 40px 20px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.jt_vcard_title_block h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.jt_vcard_title_block span {
    color: #e2e8f0;
    font-size: 12.5px;
    font-weight: 500;
}

/* No-Image Header */
.jt_vcard_header_text {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 24px 0 24px;
    cursor: pointer;
}

.jt_vcard_title_block_dark h3 {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.jt_vcard_title_block_dark span {
    color: #64748b;
    font-size: 12.5px;
    font-weight: 500;
}

/* View Deal Button */
.jt_vcard_btn {
    background-color: #b22222;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0; 
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.2s;
    border: none;
    cursor: pointer;
}
.jt_vcard_btn:hover { 
    background-color: #8b0000; 
    color: #ffffff;
}

/* Expandable Grid Engine */
.jt_vcard_expandable {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.jt_vcard_content {
    min-height: 0; 
    overflow: hidden;
}

.jt_vcard_inner_pad {
    padding: 20px 24px 0 24px;
}

.jt_vcard_intro {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Deal Data Grid */
.jt_tm_deal_grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 12px 0;
    gap: 12px;
}

.jt_tm_deal_grid.border-top {
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.jt_tm_grid_item {
    font-size: 12px;
    color: #334155;
}

.jt_tm_grid_item strong {
    display: block;
    font-size: 10px;
    color: #888888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jt_tm_grid_item i {
    color: #b22222;
    margin-right: 4px;
}

.jt_price_highlight {
    color: #b22222;
    font-weight: 700;
    font-size: 13.5px;
}

/* Status Pills */
.jt_status_pill {
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.jt_status_pill.approved { background: #d1fae5; color: #065f46; }
.jt_status_pill.pending { background: #fef3c7; color: #92400e; }
.jt_status_pill.rejected { background: #fee2e2; color: #991b1b; }

/* Toggle Chevron */
.jt_vcard_toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 0 16px 0;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    outline: none;
    display: flex;
    justify-content: center;
}

.jt_vcard_toggle i {
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- EXPANDED CARD STATES --- */
.jt_vcard.expanded .jt_vcard_expandable { grid-template-rows: 1fr; }
.jt_vcard.expanded .jt_vcard_toggle i { transform: rotate(-180deg); }
.jt_vcard.expanded .jt_vcard_btn { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Empty state */
.jt_empty_state {
    text-align: center;
    padding: 48px 24px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px dashed #cbd5e1;
    color: #64748b;
}

.jt_empty_state i {
    font-size: 40px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.jt_empty_state h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

/* Deal Detail Modal */
.jt_modal_backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.jt_modal_backdrop.active {
    display: flex;
}

.jt_modal_card {
    background: #ffffff;
    border-radius: 20px;
    max-width: 650px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jt_modal_header {
    position: relative;
    padding: 24px;
    background: #111827;
    color: #ffffff;
}

.jt_modal_header h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 6px;
}

.jt_modal_header p {
    font-size: 13px;
    color: #94a3b8;
}

.jt_modal_close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.jt_modal_close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.jt_modal_body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.jt_modal_section_title {
    font-size: 12px;
    font-weight: 700;
    color: #888888;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.jt_modal_text {
    font-size: 13.5px;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 20px;
}

.jt_modal_footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.jt_modal_btn_close {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.jt_modal_btn_action {
    background: #b22222;
    color: #ffffff;
    border: none;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.jt_modal_btn_action:hover {
    background: #8b0000;
}

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */
@media (max-width: 992px) {
    .jt_trademart_container { flex-direction: column; }
    .jt_tm_communities, .jt_tm_feed { flex: 0 0 100%; max-width: 100%; position: static; }
    .jt_tm_deal_grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .jt_tm_feed_filters { flex-direction: column; }
}

/* ==========================================
   LAZY LOADING & LOAD MORE STYLES
   ========================================== */
.jt_lazy_loader {
    text-align: center;
    padding: 16px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.jt_lazy_loader i {
    color: #b22222;
    margin-right: 6px;
}

.jt_lazy_action_wrap {
    text-align: center;
    padding: 14px 0 6px 0;
}

.jt_btn_load_more {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    padding: 9px 20px;
    border-radius: 24px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.jt_btn_load_more:hover {
    background: #b22222;
    border-color: #b22222;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(178,34,34,0.15);
}

.jt_btn_load_more i {
    font-size: 11px;
}

.jt_end_message {
    font-size: 11.5px;
    color: #94a3b8;
    padding: 8px 0;
}

.jt_empty_state_sm {
    text-align: center;
    padding: 24px 12px;
    color: #94a3b8;
    font-size: 12.5px;
}

.jt_empty_state_sm i {
    font-size: 24px;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: block;
}

.jt_group_activity_text {
    font-size: 11px;
    color: #888888;
}

