/* ========================================================== */
/* 1. CSS Variables & Global Resets (Modern Approach)         */
/* ========================================================== */
:root {
    /* Primary Colors (New Highlight: #1DA1F2 - Light Blue) */
    --primary-color: #1DA1F2;      /* Light Blue/Twitter Blue */
    --primary-hover: #0C85D2;      /* Darker shade of Blue */
    --secondary-color: #6c757d;    /* Grey for text */
    
    /* Accent & Action Colors (New Highlight: #F58220 - Orange) */
    --accent-color: #F58220;       /* Orange for positive actions (Post Ad, Save Profile) */
    --warning-color: #ffc107;      /* Yellow for standard warnings/status (Kept for contrast) */
    
    /* Danger Color (New Highlight: #E91E63 - Pink/Magenta) */
    --danger-color: #E91E63;       /* Pink/Magenta for price highlight/delete */
    
    /* NEW Price Color (Green for good sale/price) */
    --price-color: #28a745;        /* Green for price */

    /* Backgrounds & Shadows */
    --body-bg: #ffffff;            /* CHANGED: Global white background */
    --card-bg: #ffffff;            /* Kept white */
    --box-shadow-light: 0 4px 12px rgba(0, 0, 0, 0.08); /* Soft, deep shadow */
    --box-shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.15);
    
    /* Spacing & Radius */
    --spacing-unit: 1rem;
    --border-radius-large: 10px;
    --border-radius-small: 5px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* REDUCED FONT SIZE for "Normal" look */
    font-size: 0.9rem; /* Further reduced global base font size */
    background-color: var(--body-bg);
    color: #343a40;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================================== */
/* 2. Layout & Container                                      */
/* ========================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-unit);
    display: flex;
    flex-direction: column;
}

/* ========================================================== */
/* 3. Header & Auth Status (Styling the Top Bar)              */
/* ========================================================== */
header {
    background-color: var(--card-bg);
    padding: 0;
    margin-bottom: 0; 
    box-shadow: none; 
    border-bottom: none; 
}
header h1 {
    display: none; 
}

#logo-under-filter {
    text-align: center;
    margin-bottom: 0px; 
    padding-top: 0px;
    padding-bottom: 5px; 
    order: -2;
    background-color: var(--card-bg);
}

/* CLS FIX: Fixed dimensions for logo and reserved space using object-fit */
#header-logo {
    width: 400px; /* MODIFIED: Increased width for a bigger logo */
    height: 100px; /* MODIFIED: Increased height for a bigger logo */
    object-fit: contain; /* Ensure logo scales correctly within the reserved space */
    cursor: pointer;
    transition: transform 0.3s ease;
}
#header-logo:hover {
    transform: scale(1.05);
}

#auth-status {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 0;
    order: -1;
}

#profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--primary-color);
    transition: box-shadow 0.2s;
}
#profile-img:hover {
    box-shadow: 0 0 0 4px rgba(29, 161, 242, 0.3);
}

#profile-dropdown-container {
    position: relative;
}

/* FIX: Added display: none; to prevent automatic appearance */
#profile-dropdown-menu {
    position: absolute;
    top: 55px; /* Adjusted slightly */
    right: 0;
    background-color: var(--card-bg);
    min-width: 180px;
    box-shadow: var(--box-shadow-light);
    border-radius: var(--border-radius-small);
    z-index: 1000;
    overflow: hidden;
    display: none; 
}

#profile-dropdown-menu a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--secondary-color);
    transition: background-color 0.2s;
    font-size: 0.9rem; /* Adjusted for consistency */
}

#profile-dropdown-menu a:hover {
    background-color: var(--body-bg);
    color: var(--primary-color);
}

#google-login-btn, #post-ad-btn {
    padding: 8px 12px; /* Slightly reduced padding */
    border-radius: var(--border-radius-small);
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
    white-space: nowrap;
    font-size: 0.85rem; /* Further reduced font size */
}

#google-login-btn {
    background-color: var(--primary-color);
    color: white;
}
#google-login-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* ========================================================== */
/* 4. Filter Bar (Modern Flex Layout)                         */
/* ========================================================== */
#filter-bar {
    display: flex;
    gap: 8px; /* Reduced gap */
    padding: 10px; /* Reduced padding */
    background-color: var(--card-bg);
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-light);
    margin-bottom: var(--spacing-unit);
    flex-wrap: wrap;
}

#filter-bar input, #filter-bar select {
    flex-grow: 1;
    min-width: 150px;
    padding: 7px 10px; /* Reduced padding further for smaller size */
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem; /* Reduced font size further */
}

/* ========================================================== */
/* 5. Listings & Product Cards (Grid & Slider)                */
/* ========================================================== */

/* CLS FIX: Set min-height to reserve space for listings before content loads */
#listings-view-container {
    min-height: 400px; 
}

#listings-container h3, #listings-container h2 {
    margin: 15px 0 8px 0; /* Reduced margin */
    /* MODIFIED: Changed color to black/dark grey as requested */
    color: #343a40; /* Blackish color */
    border-left: 5px solid var(--accent-color);
    padding-left: 10px;
    /* MODIFIED: Reduced font size further as requested */
    font-size: 1.1rem; 
    
    /* FIX: Stabilize the height of the category title for CLS */
    line-height: 1.2;
    min-height: 25px; 
}

.product-card {
    position: relative; 
    background-color: var(--card-bg);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--box-shadow-light);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    padding: var(--spacing-unit); /* Keep padding for text content */
    display: flex;
    flex-direction: column;
    
    /* FIX: Add min-height to card to prevent layout shift */
    min-height: 280px; 
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-hover);
}

/*
    MODIFICATION for "Product k image full karo without border karo full view mile"
*/
.product-card-img {
    /* Stretch to fill the top/side padding of the parent .product-card */
    margin-top: calc(-1 * var(--spacing-unit)); 
    margin-left: calc(-1 * var(--spacing-unit));
    margin-right: calc(-1 * var(--spacing-unit)); 
    margin-bottom: 8px; /* Reduced separation */

    width: calc(100% + 2 * var(--spacing-unit)); /* Stretch to fill the lost width */
    
    aspect-ratio: 4/3; /* Reserve 4:3 space */
    object-fit: cover;
    
    /* Adjust border radius for flush corners */
    border-top-left-radius: var(--border-radius-large) !important; 
    border-top-right-radius: var(--border-radius-large) !important; 
    border-bottom-left-radius: 0 !important; 
    border-bottom-right-radius: 0 !important; 
}


.product-card h3 {
    /* REDUCED FONT SIZE */
    font-size: 0.9rem;
    margin: 0 0 4px 0; /* Reduced margin */
    /* MODIFIED: Changed color to Blue as requested */
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    
    /* FIX: Add min-height for stable layout if title is one line */
    min-height: 30px;
}

.product-card .price {
    /* REDUCED FONT SIZE */
    font-size: 0.95rem;
    font-weight: bold;
    /* MODIFIED: Changed color to Green as requested */
    color: var(--price-color); 
    margin-bottom: 4px; /* Reduced margin */
}

/* Explicitly set smaller font for the small text in cards */
.product-card small {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Adjusted minmax for a slightly smaller card */
    gap: 12px; /* Reduced gap */
    margin-top: 10px; /* Reduced margin */
}

.category-slider {
    margin-bottom: 25px; /* Reduced margin */
}
.category-slider h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* Reduced margin */
    /* MODIFIED: Reduced font size further as requested */
    font-size: 1.1rem; 
}
.see-more-link {
    font-size: 0.8rem; /* Reduced font size */
    color: var(--primary-color);
    text-decoration: none;
    font-weight: normal;
}

.slider-content {
    display: flex;
    overflow-x: scroll;
    padding-bottom: 10px; /* Reduced padding */
    gap: 12px; /* Reduced gap */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.slider-content > .product-card {
    flex: 0 0 220px; /* Reduced card width */
    scroll-snap-align: start;
}

.slider-content::-webkit-scrollbar {
    display: none;
}
.slider-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ========================================================== */
/* 6. Detail View & Image Gallery                             */
/* ========================================================== */
#detail-view-container {
    background-color: var(--card-bg);
    padding: 15px; /* Reduced padding */
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-light);
    min-height: 500px; /* CLS FIX: Reserve space */
}

#detail-view-container h2 {
    font-size: 1.4rem; /* Reduced font size */
}
#detail-view-container h3 {
    font-size: 1.1rem; /* Reduced font size */
}
#detail-view-container p {
    font-size: 0.85rem; /* Adjusted detail text size */
}


#image-gallery-container {
    position: relative;
    margin-bottom: 15px; /* Reduced margin */
    overflow: hidden;
    border-radius: var(--border-radius-large);
}

/* CLS FIX: Use aspect-ratio or fixed height */
#detail-image-slider {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* CHANGE: Replaced height: 300px; with aspect-ratio: 1/1; to make it SQUARE as requested */
    aspect-ratio: 1/1; 
    height: auto;
    border-radius: var(--border-radius-large);
    background-color: #eee;
}
#detail-image-slider::-webkit-scrollbar { display: none; }
#detail-image-slider { -ms-overflow-style: none; scrollbar-width: none; }


.detail-gallery-img {
    flex-shrink: 0;
    width: 100%;
    object-fit: contain;
    scroll-snap-align: start;
}

#slider-nav {
    position: absolute;
    bottom: 8px; /* Reduced distance */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px; /* Reduced gap */
}
.slider-dot {
    width: 8px; /* Reduced size */
    height: 8px; /* Reduced size */
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid var(--primary-color);
}
.slider-dot.active {
    background-color: var(--primary-color);
    border-color: white;
}

#ad-action-buttons-container {
    display: flex;
    gap: 8px; /* Reduced gap */
}
#ad-action-buttons-container button, #ad-action-buttons-container a {
    padding: 8px; /* Reduced padding */
    border-radius: var(--border-radius-small);
    font-weight: bold;
    flex-grow: 1;
    transition: transform 0.1s;
    font-size: 0.85rem; /* Reduced font size */
}
#ad-action-buttons-container button:active, #ad-action-buttons-container a:active {
    transform: scale(0.98);
}

#share-ad-btn {
    display: none !important; 
}

.chat-contact-btn {
    display: block;
    width: 100%;
    padding: 10px; /* Reduced padding */
    text-align: center;
    border-radius: var(--border-radius-small);
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    margin-top: 8px; /* Reduced margin */
    transition: background-color 0.2s;
    font-size: 0.9rem; /* Reduced font size */
}

#quick-contact-container {
    display: flex;
    gap: 8px; /* Reduced gap */
    margin-top: 8px; /* Reduced margin */
    margin-bottom: 15px; /* Reduced margin */
}
#quick-contact-container .chat-contact-btn {
    flex-grow: 1;
    margin: 0;
    font-size: 0.85rem; /* Further reduced size for quick buttons */
    padding: 6px; /* Further reduced padding */
}

#in-app-chat-btn-quick, #in-app-chat-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
}
#whatsapp-chat-btn-quick, #whatsapp-chat-btn {
    background-color: #25d366;
    color: white;
    border: none;
}

#related-ads-content {
    margin-bottom: 8px; /* Reduced margin */
}


/* ========================================================== */
/* 7. Ad Post Form (Clean Input Styles)                       */
/* ========================================================== */
#ad-post-view-container {
    background-color: var(--card-bg);
    padding: 15px; /* Reduced padding */
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-light);
    min-height: 500px; /* CLS FIX: Reserve space */
}

#ad-post-form input[type="text"], 
#ad-post-form input[type="file"],
#ad-post-form select, 
#ad-post-form textarea {
    width: 100%;
    padding: 8px 12px; /* Reduced padding */
    margin-bottom: 12px; /* Reduced margin */
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem; /* Reduced font size */
    transition: border-color 0.3s, box-shadow 0.3s;
}

#ad-post-form textarea {
    min-height: 80px; /* Reduced min-height */
    resize: vertical;
}

#ad-post-form input:focus, 
#ad-post-form select:focus, 
#ad-post-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(29, 161, 242, 0.25);
    outline: none;
}

#ad-post-form label {
    display: block;
    margin-bottom: 4px; /* Reduced margin */
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 0.9rem; /* Adjusted for consistency */
}

/* --- NEW CSS for Pinpoint Location Switch (User Request) --- */
#ad-post-content input[type="checkbox"] + label {
    display: inline-block; /* Ensure label sits next to checkbox */
    cursor: pointer;
    margin-left: 5px;
    font-weight: bold;
    color: var(--primary-color);
}
/* This ensures the entire div doesn't act like a label, keeping margin-bottom separate */
#ad-post-content .checkbox-group { 
    margin-bottom: 15px;
}
/* --- END NEW CSS --- */


#ad-post-form button[type="submit"] {
    display: block;
    width: 100%;
    /* INCREASED SIZE */
    padding: 12px; 
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    /* INCREASED SIZE */
    font-size: 1.05rem; 
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}
#ad-post-form button[type="submit"]:hover {
    background-color: var(--primary-hover);
}
#ad-post-form button[type="submit"]:disabled {
    background-color: #a0c9f1;
    cursor: not-allowed;
}

/* ========================================================== */
/* 7.5. Profile Setup/Edit Forms                              */
/* ========================================================== */

#profile-setup-container {
    background-color: var(--card-bg);
    padding: 15px; /* Reduced padding */
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-light);
    max-width: 500px;
    margin: 15px auto; /* Reduced margin */
}

#profile-setup-form input[type="text"],
#profile-setup-form textarea,
#profile-edit-form input[type="text"], 
#profile-edit-form textarea {
    width: 100%;
    padding: 8px 12px; /* Reduced padding */
    margin-bottom: 12px; /* Reduced margin */
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem; /* Reduced font size */
    transition: border-color 0.3s, box-shadow 0.3s;
}

#profile-setup-form textarea,
#profile-edit-form textarea {
    min-height: 70px; /* Reduced min-height */
    resize: vertical;
}

#setup-profile-btn, #update-profile-btn {
    display: block;
    width: 100%;
    padding: 10px; /* Reduced padding */
    background-color: var(--accent-color); 
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 0.95rem; /* Reduced font size */
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}
#setup-profile-btn:hover, #update-profile-btn:hover {
    background-color: #D56B13;
}
#setup-profile-btn:disabled, #update-profile-btn:disabled {
    background-color: #f7bb91;
    cursor: not-allowed;
}

#profile-edit-form label {
    display: block;
    margin-top: 8px; /* Reduced margin */
    margin-bottom: 4px; /* Reduced margin */
    font-weight: bold;
    color: #343a40; 
    font-size: 0.9rem; /* Adjusted for consistency */
}

#current-profile-img {
    border: 3px solid var(--primary-color);
    box-shadow: var(--box-shadow-light);
}

/* ========================================================== */
/* 8. My Account & Inbox (Refactored for Professional UX)     */
/* ========================================================== */

#my-account-view-container, #public-profile-view-container {
    background-color: var(--card-bg);
    padding: 20px; /* Reduced padding */
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-light);
    margin-bottom: 15px; /* Reduced margin */
}
#my-account-view-container h2, #public-profile-view-container h2 {
    font-size: 1.4rem; /* Reduced font size */
}

/* CLS FIX: Reserve space for dynamic content inside my-account-content */
#my-account-content {
    min-height: 300px;
}
#public-profile-listings-content {
    min-height: 300px;
}

/* New: Container for the Account Navigation Buttons (Tabs) */
.account-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Reduced gap */
    margin-bottom: 15px; /* Reduced margin */
    padding-top: 4px; /* Reduced padding */
}

.account-btn {
    /* Refined for a Pill/Tab Look */
    flex-grow: 1; 
    min-width: 0;
    text-align: center;
    padding: 8px 15px; /* Reduced padding */
    border: 1px solid #e0e0e0; /* Subtle light grey border */
    background-color: transparent;
    border-radius: 20px; /* Reduced rounding */
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem; /* Reduced font size */
}

.account-btn i, .account-btn svg { /* Assuming icons are used, like the person/envelope/star in the image */
    margin-right: 6px; /* Reduced margin */
    font-size: 0.9rem; /* Reduced icon size */
}

.account-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600; /* Slightly bolder */
    box-shadow: 0 3px 8px rgba(29, 161, 242, 0.2); /* Subtle shadow for depth */
}
.account-btn:hover:not(.active) {
    background-color: #f7f7f7; /* Very light hover effect */
    color: var(--primary-color);
    border-color: var(--primary-color);
}

hr {
    border: 0;
    height: 1px;
    background: #f0f0f0; /* Lighter separator */
    margin: 12px 0; /* Reduced margin */
}

/* ========================================================== */
/* 8.1. User & Inbox List Styling (Refined)                   */
/* ========================================================== */

/* New: Professional Card for Following/User List Item (applies to My Following users) */
.user-list-card { 
    display: flex;
    align-items: center;
    padding: 12px 0; /* Reduced padding */
    border-bottom: 1px solid #f0f0f0; /* Light separator */
    transition: background-color 0.1s;
    gap: 12px; /* Reduced gap */
    cursor: pointer; /* Makes the entire row feel clickable */
}
.user-list-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.user-list-card:hover {
    background-color: #fafafa;
}

/* Avatar Styling (Replaces M-circle in the image) */
.user-list-card .avatar-circle { 
    width: 45px; /* Reduced size */
    height: 45px; /* Reduced size */
    border-radius: 50%;
    background-color: #795548; /* Brown color from image */
    color: white;
    font-size: 1.1rem; /* Reduced font size */
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border: 2px solid white; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* User & Ad Info */
.user-info-content {
    flex-grow: 1;
    min-width: 0; 
}

.user-info-content .name {
    font-size: 0.9rem; /* Reduced font size */
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2px; /* Reduced margin */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info-content .detail-text {
    font-size: 0.75rem; /* Reduced font size */
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.user-info-content .detail-text.latest-ad {
    color: #343a40; /* Make the ad title slightly darker than other details */
}

/* Follow Status and Action Button Container */
.status-action-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px; /* Reduced gap */
    flex-shrink: 0;
}

.status-action-group .date-text {
    font-size: 0.7rem; /* Reduced font size */
    color: #999;
    white-space: nowrap;
}

/* Refined Unfollow Button Style (Less aggressive, better hover) */
.unfollow-btn { 
    padding: 5px 10px; /* Reduced padding */
    border: 1px solid #ced4da; /* Neutral border */
    background-color: white;
    color: var(--secondary-color);
    border-radius: var(--border-radius-small);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    min-width: 80px; /* Reduced min-width */
    text-align: center;
    font-size: 0.8rem; /* Reduced font size */
}

.unfollow-btn:hover {
    border-color: var(--danger-color); /* Subtle change on hover */
    color: var(--danger-color);
    background-color: #fff8f8; /* Very light pink background */
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(233, 30, 99, 0.15);
}

/* Existing Inbox Thread Card - Keeping original but applying visual update */
.inbox-thread-card {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    transition: background-color 0.2s;
    border-radius: var(--border-radius-small);
    min-width: 0;
    max-width: 100%;
}

.inbox-thread-card:hover {
    background-color: #f0f0f0;
}

.inbox-thread-card img {
    width: 45px; /* Reduced size */
    height: 45px; /* Reduced size */
    object-fit: cover;
    border-radius: 50%; 
    margin-right: 12px; /* Reduced margin */
    flex-shrink: 0;
}

.inbox-thread-info {
    flex-grow: 1;
    min-width: 0;
}

.inbox-ad-title {
    font-weight: bold;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem; /* Reduced font size */
}

.inbox-last-message {
    font-size: 0.8rem; /* Reduced font size */
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-timestamp {
    font-size: 0.7rem; /* Reduced font size */
    color: #999;
    flex-shrink: 0;
    align-self: flex-start;
}


/* ========================================================== */
/* 8.5. VIP SOCIAL/PROFILE ELEMENTS (Unchanged)               */
/* ========================================================== */

#detail-poster-info-clickable {
    display: inline-flex !important;
    align-items: center;
    background-color: #e0f7fa !important; 
    padding: 7px 12px !important; /* Reduced padding */
    border-radius: 20px !important; /* Reduced rounding */
    border: 2px solid var(--primary-color) !important; 
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#detail-poster-info-clickable:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-1px);
}

#detail-poster-info-clickable:hover span,
#detail-poster-info-clickable:hover small {
    color: white !important;
    text-decoration: underline;
}

#detail-poster-img {
    width: 30px !important; /* Reduced size */
    height: 30px !important; /* Reduced size */
    border-radius: 50% !important;
    object-fit: cover;
    border: 1px solid white; 
    margin-right: 8px !important; /* Reduced margin */
}

.unfollowed-btn {
    padding: 6px 10px; /* Reduced padding */
    font-weight: bold;
    border-radius: var(--border-radius-small);
    background-color: var(--accent-color) !important; 
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 6px rgba(245, 130, 32, 0.3);
    transition: all 0.2s ease;
    font-size: 0.85rem; /* Reduced font size */
}
.unfollowed-btn:hover {
    background-color: #D56B13 !important; 
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(245, 130, 32, 0.5);
}

.followed-btn {
    padding: 6px 10px; /* Reduced padding */
    font-weight: bold;
    border-radius: var(--border-radius-small);
    background-color: var(--primary-color) !important; 
    color: white !important;
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 4px 6px rgba(29, 161, 242, 0.3);
    opacity: 0.8; 
    cursor: default;
    font-size: 0.85rem; /* Reduced font size */
}
.followed-btn:hover {
    opacity: 1;
    transform: none;
    box-shadow: 0 4px 6px rgba(29, 161, 242, 0.5);
}

/* ========================================================== */
/* 9. Chat View (Modern Messaging)                            */
/* ========================================================== */
#chat-section {
    background-color: var(--body-bg);
    border-radius: var(--border-radius-large);
    overflow: hidden;
}

.chat-product-header {
    display: flex;
    align-items: center;
    padding: 8px 12px; /* Reduced padding */
    background-color: var(--card-bg);
    border-bottom: 1px solid #ddd;
    box-shadow: var(--box-shadow-light);
    font-size: 0.9rem; /* Adjusted font size */
}

.chat-product-header img {
    width: 45px; /* Reduced size */
    height: 45px; /* Reduced size */
    object-fit: cover;
    border-radius: var(--border-radius-small);
    margin-right: 8px; /* Reduced margin */
}

#message-list {
    height: 60vh;
    overflow-y: scroll;
    padding: 12px; /* Reduced padding */
    display: flex;
    flex-direction: column;
    gap: 6px; /* Reduced gap */
    background-color: #f7f7f7;
}

.message-item {
    max-width: 70%;
    padding: 7px 10px; /* Reduced padding */
    border-radius: 15px; /* Reduced rounding */
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    font-size: 0.85rem; /* Reduced font size */
}

.message-item.sent {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-item.received {
    background-color: var(--card-bg);
    color: #343a40;
    align-self: flex-start;
    border: 1px solid #ddd;
    border-bottom-left-radius: 4px;
}

.message-meta {
    display: block;
    text-align: right;
    font-size: 0.7rem; /* Reduced font size */
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px; /* Reduced margin */
}
.message-item.received .message-meta {
     color: #999;
}

#message-input-form {
    display: flex;
    padding: 8px 10px; /* Reduced padding */
    background-color: var(--card-bg);
    border-top: 1px solid #ddd;
}

#message-input {
    flex-grow: 1;
    padding: 8px; /* Reduced padding */
    border: 1px solid #ddd;
    border-radius: var(--border-radius-small);
    margin-right: 8px; /* Reduced margin */
    font-size: 0.9rem; /* Reduced font size */
}

#message-input-form button {
    padding: 8px 12px; /* Reduced padding */
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 0.9rem; /* Reduced font size */
}

#chat-quick-reply-container {
    display: flex;
    overflow-x: scroll;
    gap: 6px; /* Reduced gap */
    padding: 8px 12px; /* Reduced padding */
    background-color: var(--card-bg);
    border-bottom: 1px solid #eee;
    -webkit-overflow-scrolling: touch;
}
#chat-quick-reply-container::-webkit-scrollbar { display: none; }

.quick-reply-btn {
    flex-shrink: 0;
    padding: 5px 8px; /* Reduced padding */
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 15px; /* Reduced rounding */
    cursor: pointer;
    font-size: 0.75rem; /* Reduced font size */
    white-space: nowrap;
    transition: background-color 0.2s;
}
.quick-reply-btn:hover {
    background-color: var(--primary-color);
    color: white;
}


/* ========================================================== */
/* 10. Footer & Splash Screen                                 */
/* ========================================================== */
#main-footer {
    text-align: center;
    padding: 15px 0; /* Reduced padding */
    margin-top: 25px; /* Reduced margin */
    border-top: 1px solid #ddd;
    background-color: var(--card-bg);
    font-size: 0.8rem; /* Reduced font size */
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 15px; /* Reduced gap */
    margin-bottom: 10px; /* Reduced margin */
}

.footer-links a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--primary-color);
}

#inbox-notification-bar {
    position: fixed;
    top: 8px; /* Reduced top position */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: white;
    padding: 10px 15px; /* Reduced padding */
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-hover);
    z-index: 5000;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.3s;
    display: none;
    font-size: 0.9rem; /* Adjusted font size */
}

/* ========================================================== */
/* 10.5. Splash Screen (Re-added for 5-second JS visibility)  */
/* ========================================================== */

/* Keyframes for the pulsing logo */
@keyframes pulse-splash {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--body-bg); /* Use white background or a light color */
    display: flex; /* Initially visible */
    justify-content: center;
    align-items: center;
    z-index: 9999; 
    opacity: 1; 
    visibility: visible;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out; /* Smooth fade-out */
}

/* This class will be added by JavaScript after 5 seconds */
#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Allows clicking through once hidden */
}

.splash-content {
    text-align: center;
}

.splash-content img {
    width: 250px; /* Logo size */
    height: auto;
    max-width: 80vw;
    animation: pulse-splash 2s infinite ease-in-out; /* Apply pulse animation */
    margin-bottom: 20px;
    object-fit: contain;
}

.splash-loading-text {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 15px;
}

/* Simple Spinner/Loader (Optional) */
.splash-spinner {
    border: 4px solid rgba(29, 161, 242, 0.2); /* Light blue base */
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 15px auto 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================================== */
/* 11. Static Page (Contact/Policy) Styles                    */
/* ========================================================== */

.static-page-container { 
    max-width: 800px; 
    margin: 25px auto; /* Reduced margin */
    padding: 30px; /* Reduced padding */
    background-color: var(--card-bg);
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-light);
}

.static-page-header { 
    text-align: center; 
    margin-bottom: 25px; /* Reduced margin */
    border-bottom: 2px dashed #eee; 
    padding-bottom: 15px; /* Reduced padding */
}
.static-page-header h1 {
    color: var(--primary-color);
    margin-top: 10px; /* Reduced margin */
    font-size: 1.6rem; /* Reduced font size */
}
.static-page-header h3 {
     font-size: 1.2rem;
     margin-top: 15px;
}
.static-page-header p {
     font-size: 0.9rem;
}
.static-page-header a { 
    color: var(--accent-color); 
    text-decoration: none; 
    font-weight: bold;
}

.urdu-text { 
    direction: rtl; 
    text-align: right; 
    margin-bottom: 15px; /* Reduced margin */
    border-bottom: 1px solid #eee; 
    padding-bottom: 10px; /* Reduced padding */
    font-size: 0.95rem; /* Reduced font size */
}

.english-translation { 
    direction: ltr; 
    text-align: left; 
    background-color: #e8f4ff;
    padding: 12px; /* Reduced padding */
    border-left: 5px solid var(--primary-color); 
    margin-top: 12px; /* Reduced margin */
    border-radius: var(--border-radius-small);
    font-size: 0.85rem; /* Reduced font size */
}

.contact-form-group { 
    margin-bottom: 15px; /* Reduced margin */
    direction: rtl; 
    text-align: right; 
}
.contact-form-group label { 
    display: block; 
    margin-bottom: 6px; /* Reduced margin */
    font-weight: bold; 
    color: var(--primary-color);
    font-size: 0.9rem; /* Reduced font size */
}
.contact-form-group input, 
.contact-form-group textarea {
    width: 100%;
    padding: 8px; /* Reduced padding */
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-small);
    box-sizing: border-box; 
    direction: rtl; 
    font-size: 0.9rem; /* Reduced font size */
}
.contact-form-group button {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 12px; /* Reduced padding */
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 0.95rem; /* Reduced font size */
}


/* ========================================================== */
/* 12. Media Queries (Mobile First)                           */
/* ========================================================== */

@media (max-width: 768px) {
    .container {
        padding: 8px; /* Reduced padding */
    }

    /* NEW: Adjust the body padding for the bottom fixed navigation */
    body {
        /* Nav is 60px high, add 10px buffer */
        padding-bottom: 70px; 
    }

    /* CLS FIX: Adjust logo size for mobile */
    #header-logo {
        width: 250px; /* MODIFIED: Increased width for a bigger logo on mobile */
        height: 70px; /* MODIFIED: Increased height for a bigger logo on mobile */
    }
    
    #auth-status {
        justify-content: space-between;
        padding: 0; 
    }
    
    /* Move Google Login Button to a more prominent position on mobile */
    #google-login-btn {
        flex-grow: 1;
    }

    /* Hide the header's Post Ad button since there's a huge one at the bottom */
    #post-ad-btn {
        display: none;
    }
    
    #filter-bar {
        flex-direction: column;
        padding: 6px; /* Reduced padding */
        gap: 5px; /* Reduced gap */
        border-radius: var(--border-radius-small);
    }
    #filter-bar input, #filter-bar select {
        min-width: 100%;
        padding: 6px; /* Reduced padding */
        font-size: 0.85rem; /* Reduced font size */
    }
    
    .grid-view {
        grid-template-columns: repeat(2, 1fr); 
    }
    
    #quick-contact-container {
        flex-wrap: wrap;
    }
    #quick-contact-container .chat-contact-btn {
        width: 100%;
    }
    
    #detail-image-slider {
        /* Already updated for square, but keeping media query */
        aspect-ratio: 1/1; 
        height: auto;
    }
    
    .static-page-container {
        padding: 15px; /* Reduced padding */
        margin: 8px; /* Reduced margin */
    }

    .footer-links {
        flex-direction: column;
        gap: 4px; /* Reduced gap */
    }
    
    /* Mobile-specific updates for My Account tabs */
    .account-tabs {
        flex-direction: column;
        gap: 5px; /* Reduced gap */
    }
    .account-btn {
        width: 100%;
        border-radius: var(--border-radius-small); /* Less aggressive rounding on mobile */
        font-size: 0.8rem; /* Further reduced font size */
        padding: 6px 12px; /* Adjusted padding */
    }

    /* Mobile-specific updates for Following list */
    .user-list-card {
        padding: 6px 0; /* Reduced padding */
        gap: 6px; /* Reduced gap */
    }
    
    .status-action-group {
        align-items: center;
        flex-direction: row; /* Put date and button side-by-side on very small screens */
        gap: 8px; /* Reduced gap */
    }
    .status-action-group .unfollow-btn {
        padding: 5px 8px; /* Smaller button on mobile */
        min-width: 70px;
    }

    /* MODIFIED: Re-position the floating-sell-btn to sit on the bottom-nav */
    #floating-sell-btn {
        /* FAB height is 90px. Bottom nav is 60px. 60 - (90/2) = 15px */
        bottom: 15px; 
        animation: pulse-ad 1.5s infinite ease-in-out alternate; /* Keep the animation */
    }
    /* Show the new bottom nav */
    #mobile-bottom-nav {
        display: flex; 
    }
}

/* ========================================================== */
/* 13. Floating Action Button & Animation (FIXED)             */
/* ========================================================== */

/* 1. Define the Animation */
@keyframes pulse-ad {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 0.9; } /* Slightly larger scale */
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* 2. Apply Animation and Sizing */
#floating-sell-btn {
    position: fixed;
    bottom: 40px; 
    left: 50%;
    /* We need to keep the translateX(-50%) for centering, so we only animate scale and opacity */
    width: 90px; /* INCREASED SIZE */
    height: 90px; /* INCREASED SIZE */
    background-color: transparent; 
    border: none;
    padding: 0;
    border-radius: 50%; 
    box-shadow: none; 
    cursor: pointer;
    z-index: 2001; /* High z-index, above the bottom nav */
    
    /* Apply the animation */
    animation: pulse-ad 1.5s infinite ease-in-out alternate;
}

#floating-sell-btn img {
    display: block;
    width: 100%; 
    height: 100%;
    object-fit: contain;
}

/* ========================================================== */
/* 13.5. Bottom Mobile Navigation (Home, Chats, My Ads, Account) */
/* ========================================================== */

/* The overall bar container (Hidden on large screens) */
#mobile-bottom-nav {
    display: none; /* Default hidden */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Fixed height for the bar */
    background-color: var(--card-bg); /* White */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1999; /* Below the FAB */
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: space-around;
    align-items: center;
}

/* Navigation items (Home, Chats, My Ads, Account) */
.nav-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #343a40; /* Dark grey text as per image */
    flex-grow: 1;
    font-size: 0.75rem; /* Small text */
    padding: 5px 0;
    user-select: none;
    transition: color 0.2s;
    height: 100%; 
    min-width: 0;
}

.nav-item-mobile i, .nav-item-mobile svg {
    font-size: 1.5rem; /* Icon size */
    margin-bottom: 2px;
    color: var(--secondary-color); /* Default icon color (lighter grey) */
}

/* Active state for icons/text (like 'Home' in the image) */
.nav-item-mobile.active {
    color: #343a40; /* Darker text for active state */
    font-weight: 600;
}
.nav-item-mobile.active i, .nav-item-mobile.active svg {
    color: #00796b; /* Dark Teal color for the active icon, based on the image's 'Home' icon */
}

/* Space for the central 'Sell' button - this item holds the space */
.nav-item-mobile.sell-spacer {
    /* 90px FAB overlaps the bar, so this space needs to be large enough */
    width: 90px; /* Equal to FAB width */
    flex-shrink: 0;
    flex-grow: 0;
    /* Optional: If needed, you can add "Sell" text here that is only visible when the FAB is not used */
}


/* NEW: Basic CSS for the Country Switcher. Please integrate this into your main style.css */
#country-switcher {
    position: relative;
    margin-top: 8px; /* Reduced margin */
    text-align: right;
    padding: 4px 0; /* Reduced padding */
    cursor: pointer;
}
#country-switcher button {
    background: none;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 4px 8px; /* Reduced padding */
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em; /* Reduced font size */
}
#country-list {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}
#country-list a {
    display: block;
    padding: 6px 10px; /* Reduced padding */
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    font-size: 0.85rem; /* Reduced font size */
}
#country-list a:hover {
    background-color: #f0f8ff;
    color: #007bff;
}
/* New styles for the Boost Modal */
.boost-option-label {
     transition: all 0.2s;
     font-size: 0.9rem; /* Adjusted font size */
}
.boost-option-label:hover {
     box-shadow: 0 0 5px #007bff;
}
/* Ensures the radio button style reflects the selected option */
.boost-option-label input[type="radio"]:checked + span {
     background-color: #007bff !important;
}
/* New styles for Follow/Unfollow button */
.followed-btn {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: default;
}
.unfollowed-btn {
    background-color: #ff8a00;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}