/*
 * WorkerMeet App - Unified & Clean Stylesheet
 *
 * This stylesheet combines and refines all previous styles for a consistent design.
 * It ensures all components, including home page cards and profile page,
 * are properly rendered.
 */


/* Global CSS resets */
* { box-sizing: border-box; }
html,body { height:100%; margin:0; padding:0; -webkit-font-smoothing:antialiased; }


/* General Styles & Variables */
:root {
  --primary-color: #d32f2f; /* Red */
  --primary-color-dark: #b71c1c;
  --primary-color-light: #f44336;
  --secondary-color: #ffffff;
  --background-color: #f0f2f5;
  --card-bg: #ffffff;
  --text-color: #333333;
  --gray-text: #666666;
  --light-gray: #e0e0e0;
  --border-color: #f0f0f0;
  --shadow-subtle: rgba(0, 0, 0, 0.08);
  --shadow-strong: rgba(0, 0, 0, 0.15);
  --bottom-nav-height: 60px;
  
  /* Enhanced Android WebView Safe Area Support */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  
  /* Fallback values for older Android WebView */
  --safe-top-fallback: 24px;
  --header-height: 56px;
  --header-total-height: calc(var(--header-height) + var(--safe-top, var(--safe-top-fallback)));
  
  /* Current theme color (updated by AndroidThemeManager) */
  --current-theme-color: var(--primary-color);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    padding-bottom: 64px;
}

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

/* Container rule */
.container, .app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}


/* Header - Enhanced for Android WebView */
header {
    /* Use total header height including safe area */
    height: var(--header-total-height);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: calc(var(--safe-top, var(--safe-top-fallback)) + 8px) 16px 8px 16px;
    background: linear-gradient(135deg, var(--current-theme-color, var(--primary-color)) 0%, var(--primary-color-dark) 100%);
    color: var(--secondary-color);
    box-shadow: 0 2px 8px var(--shadow-subtle);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}


/* Chat Window Header - Enhanced for Android WebView */
.chat-header {
    /* Use same total header height including safe area */
    height: var(--header-total-height);
    display: flex;
    align-items: flex-end;              /* Move content down to bottom */
    justify-content: space-between;
    padding: calc(var(--safe-top, var(--safe-top-fallback)) + 8px) 16px 8px 16px;
    background: linear-gradient(135deg, var(--current-theme-color, var(--primary-color)) 0%, var(--primary-color-dark) 100%);
    color: var(--secondary-color);
    box-shadow: 0 2px 8px var(--shadow-subtle);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.chat-header .chat-back {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-right: 15px;
    cursor: pointer;
    margin-bottom: 6px; /* Align with title baseline */
}

.chat-header .chat-peer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    margin-bottom: 6px; /* Align with title baseline */
}

.chat-header .chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-header .chat-meta {
    display: flex;
    flex-direction: column;
}

.chat-header .chat-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    margin-bottom: 6px; /* Baseline offset to match Home */
    color: var(--secondary-color);
}

.chat-header .chat-status {
    font-size: 0.75rem;
    opacity: 0.85;
    color: var(--secondary-color);
}

.chat-header .chat-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 6px; /* Align with title baseline */
}

.chat-header .chat-actions a {
    color: #fff;
    font-size: 1.2rem;
    margin-left: 15px;
}



/* Page Headers (Help/About/Privacy) - Enhanced for Android WebView */
header .page-title {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: 1.2rem;  /* Match Home header scale */
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1;
    margin-bottom: 6px; /* Baseline offset to match Home */
}

/* Back icon styling for page headers - consistent alignment */
header .back-icon {
    background: transparent;
    border: none;
    padding: 8px 12px;
    margin-left: 8px; /* align with header content */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .14s ease, opacity .14s ease;
    color: #ffffff; /* white arrow on red header */
    font-size: 20px;
    margin-bottom: 6px; /* Align with title baseline */
}

header .back-icon:focus {
    outline: none;
}

header .back-icon:hover {
    transform: translateY(-1px);
    opacity: .92;
}





.header-left .logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 3.5vw, 32px);
    background: linear-gradient(180deg, #FFFFFF, #F0F0F0);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    display: inline-block;
    animation: wm-float 2.8s ease-in-out infinite;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.5px;
    line-height: 1;
    margin: 0;
    padding: 0;
    will-change: transform;
}

.header-right .header-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.header-right .header-actions button {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    transition: all 0.2s ease;
}

.header-right .header-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.back-button {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-right: 15px;
    cursor: pointer;
}





/* Main Content - Enhanced for Android WebView */
.main-content {
    padding: 4px 16px 20px 16px;
    flex: 1;
    padding-bottom: calc(var(--safe-bottom, 0px) + var(--bottom-nav-height) + 20px);
    display: flex;
    width: 100%;
    max-width: 980px;
    flex-direction: column;
    /* Ensure content starts below header */
    margin-top: 0;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0 15px 0;
    color: var(--text-color);
}

.info-text {
    text-align: center;
    color: var(--gray-text);
    padding: 20px;
}

/* Helper class to hide content while loading to prevent flicker */
.content-loading {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 25px;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.search-bar i {
    color: var(--gray-text);
    margin-right: 10px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.search-bar i:hover {
    color: var(--primary-color);
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    background: transparent;
}

/* --- Live Search Results --- */
.search-results-container {
    display: none; /* Hidden by default */
    position: absolute;
    top: 125px; /* Position below the header/search bar */
    left: 20px;
    right: 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 16px var(--shadow-strong);
    z-index: 999;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.search-result-header {
    padding: 10px 15px 5px;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-text);
    text-transform: uppercase;
}
.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 15px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f7f7f7;
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-avatar img, .search-result-avatar .initials {
    width: 100%; height: 100%; object-fit: cover; color: var(--primary-color); font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; justify-content: center;
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.search-result-name {
    font-weight: 600;
}

.search-result-subtext {
    font-size: 0.8rem;
    color: var(--gray-text);
}

.search-result-price {
    font-weight: 600;
    color: var(--primary-color);
}

/* Make cards and images responsive */
.card, .listing-card, .post-form-card, .profile-info-card, .help-section-card, .about-card { width: 100%; max-width: 100%; display: block; }
.card img, .profile-pic, .worker-avatar, .listing-card .profile-pic, .profile-pic-container-home { width: 72px; height:72px; max-width:100%; object-fit:cover; border-radius:50%; }
.profile-pic-container-home { width: 120px; height: 120px; }


/* Rating stars on cards */
.listing-rating {
    font-size: 0.8rem;
    color: var(--gray-text);
    display: flex;
    align-items: center;
}
/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    text-align: center;
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 8px var(--shadow-subtle);
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-text);
}

.category-item i {
    font-size: 1.8rem;
    color: var(--primary-color);
    padding: 10px;
    background-color: rgba(211, 47, 47, 0.1);
    border-radius: 50%;
    margin-bottom: 5px;
    transition: transform 0.2s ease;
}

.category-item:hover i {
    transform: scale(1.1);
}

.category-item span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Form Styles */
.post-form-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-left: 40px;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    color: var(--gray-text);
    font-size: 1rem;
}


/* Job/Worker Listings */
.listings-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    min-height: 100vh;
    padding-bottom: 20px;
}

/* Workers List Container */
.workers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    min-height: 100vh;
    padding-bottom: 20px;
}

/* Profile My Posts Container */
#my-posts-container {
    padding-bottom: 20px;
}

/* Profile Reviews Section */
#reviews {
    margin-bottom: 20px;
}

.listing-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--card-bg);
    border-radius: 16px; /* rounded-2xl */
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); /* shadow-md */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #F3F4F6; /* border-gray-100 */
    position: relative;
    overflow: hidden;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow-strong);
}

.listing-header .profile-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.listing-card .profile-pic {
    flex-shrink: 0;
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    overflow: hidden;
    border: 2px solid var(--card-bg);
}

.listing-card .profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-card .listing-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Ensures flex item shrinks properly */
}

.listing-card .listing-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.listing-card .listing-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.listing-card .listing-info .meta {
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--gray-text);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.listing-card .listing-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    flex-shrink: 0; /* Ensures buttons don't shrink */
}

/* =============================================================== */
/* --- New Worker/Job Card Design (As per new request) --- */
/* =============================================================== */

.listing-card {
    flex-direction: column;
    gap: 0; /* Gaps are handled by margins now */
    padding: 16px; /* p-4 */
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); /* shadow-lg */
}

/* 1. Top Section */
.listing-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px; /* mb-3 */
}

.listing-initials {
    width: 56px; /* w-14 */
    height: 56px; /* h-14 */
    border-radius: 50%;
    background-color: #FEE2E2; /* Avatar fallback background */
    color: #E53935;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    border: 2px solid #E53935;
}

.listing-user-details {
    display: flex;
    align-items: center;
    gap: 12px; /* gap-3 */
    flex: 1;
}

.listing-user-info .user-name {
    font-weight: 700;
    font-size: 16px; /* text-base */
    color: #111827; /* text-gray-900 */
    line-height: 1.25; /* tight */
}

.listing-user-info .job-title-preview {
    font-size: 12px; /* text-xs */
    color: #6B7280; /* text-gray-500 */
    margin: 0;
}

.listing-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.listing-meta .posted-ago {
    font-size: 12px;
    color: #9CA3AF; /* text-gray-400 */
}


/* Style for the distance text on listing cards */
.listing-distance {
    color: #28a745; /* Green for visibility */
    white-space: nowrap; /* Prevent line breaks on Android devices */
}

.listing-type-tag {
    background-color: #E53935;
    color: #FFFFFF;
    padding: 4px 8px; /* py-1 px-2 */
    border-radius: 9999px; /* rounded-full */
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    position: absolute;
    top: 12px;
    right: 12px;
    max-width: 70%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Description */
.listing-description {
    font-size: 14px;
    color: #374151; /* text-gray-700 */
    margin: 0 0 12px 0; /* mb-3 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category + Price Row */
.listing-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px; /* mb-3 */
}

.listing-category-tag {
    border: 1px solid #E53935;
    color: #E53935;
    background-color: #FFFFFF;
    padding: 4px 12px; /* py-1 px-3 */
    border-radius: 0.375rem; /* badge default */
    font-size: 12px;
    font-weight: 500;
}

.listing-price {
    font-size: 18px; /* text-lg */
    font-weight: 700;
    color: #E53935;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Rating Row */
.listing-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px; /* mb-3 */
}

.listing-rating .stars {
    color: #F97316; /* Orange for stars */
}

.listing-rating span:not(.stars) {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.listing-rating span:not(.stars) ~ span {
    font-size: 12px;
    font-weight: 400;
    color: #6B7280;
}

/* 4. Button Row */
.listing-actions-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px; /* gap-2 */
}

.listing-action-btn {
    background-color: #E53935;
    color: #FFFFFF;
    padding: 8px 0; /* py-2 */
    border-radius: 8px; /* rounded-lg */
    text-align: center;
    font-weight: 500;
    font-size: 14px; /* text-sm */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* gap-1.5 */
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.listing-action-btn:hover {
    background-color: #C62828;
}

.listing-action-btn.delete {
    background-color: #6B7280; /* gray-500 */
}

.listing-action-btn.delete:hover {
    background-color: #4B5563; /* gray-600 */
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: inline-block;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease;
}
/* Extra tweaks for worker listing buttons */
.listing-actions .btn-primary, 
.listing-actions .btn-secondary {
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
}

.category {
  font-weight: 600;
  color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

/* Responsive typography & spacing via media queries */





/* Mobile small (phones) */
@media (max-width: 480px) {
  h1, .section-title { font-size: 20px; }
  h2 { font-size: 18px; }
  
  header {
    padding: calc(env(safe-area-inset-top) + 10px) 12px 8px 12px;
  }
  
  /* Chat Window Header Mobile Updates */
  .chat-header {
    padding: calc(env(safe-area-inset-top) + 10px) 12px 8px 12px;
  }
  
  .chat-header .chat-back {
    font-size: 1.1rem;
    margin-right: 12px;
  }
  
  .chat-header .chat-name {
    font-size: 1.1rem;
  }
  
  .chat-header .chat-avatar {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  
  /* Page Headers Mobile Updates */
  header .page-title {
    font-size: 1.1rem;
  }
  
  .header-left .logo { 
    font-size: clamp(18px, 4vw, 24px);
  }
  
  .header-right .header-actions {
    gap: 10px;
  }
  
  .header-right .header-actions button {
    width: 26px;
    height: 26px;
    font-size: 1rem;
  }
  
  .card, .listing-card, .post-form-card { padding: 14px; border-radius: 12px; }
  .listing-action-btn {
    padding: 8px;
    font-size: 0.8rem;
    flex-basis: 100px; /* Ensure buttons have enough space */
  }

  /* Status Badge Mobile Responsive */
  .listing-type-tag {
    top: 8px;
    right: 8px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
  }

  /* Keep top padding tied to header + safe area with only 4px extra gap */
  .main-content { padding: 4px 14px 20px 14px; }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
  h1, .section-title { font-size: 24px; }
  .card, .listing-card, .post-form-card { padding: 16px; }
}

/* Desktop */
@media (min-width: 769px) {
  .container, .app-container { padding: 0 24px; }
}


/* --- Global Loading Overlay --- */
#loadingOverlay {
  position: fixed;
  top: 60px; /* Start below the header */
  left: 0;
  width: 100%;
  height: calc(100% - 120px); /* Fill screen between header and bottom nav */
  background: rgba(240, 242, 245, 0.9); /* Match body background */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: #d9534f;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.3s ease-in-out;
}

#loadingOverlay.active {
  visibility: visible;
  opacity: 1;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #d9534f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: rgba(211, 47, 47, 0.1);
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    text-align: center;
}

/* Location Button - Prominent and Encouraging */
.btn-location {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    text-align: center;
}

.btn-location:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%);
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.4);
    transform: translateY(-1px);
}

.btn-location i {
    font-size: 1.1rem;
}

.btn-location:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

/* Location Helper Text */
.location-helper-text {
    font-size: 0.85rem;
    color: #666;
    margin: 6px 0 0 0;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
}

.location-helper-text::before {
    content: "💡";
    font-size: 0.9rem;
}

.listing-actions a {
    text-decoration: none;
}

.listing-actions a.primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.listing-actions a.secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Availability Status Dot */
.availability-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    z-index: 10;
}

.status-online {
    background-color: #28a745; /* Green */
}

.status-offline {
    background-color: #6c757d; /* Gray */
}

/* Profile Distance on Home page */
.worker-distance {
    font-size: 0.75rem;
    color: var(--gray-text);
    background-color: var(--light-gray);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.worker-distance i {
    margin-right: 5px;
    font-size: 0.8rem;
}

/* Popup & Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Lower than bottom nav */
    display: none;
}

.overlay.active {
    display: block;
}

.modal,
.dropdown,
.select-options {
    position: fixed;
    z-index: 1000; /* Lower than bottom nav (9999) */
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 1001; /* Lower than bottom nav */
    display: none;
    flex-direction: column;
}

.popup.active {
    display: flex;
}

.modal-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 80vh;
    overflow-y: auto;
}
/* Style for the close button inside a modal/popup */
.modal .close-btn, .popup .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.8rem;
    color: var(--gray-text);
    cursor: pointer;
    z-index: 1002;
    background: none;
    border: none;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.popup .close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.popup-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.popup-header .close-popup-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-text);
    cursor: pointer;
}

.popup-content {
    padding: 20px;
    text-align: center;
}




/* Side Menu */

.side-menu {
    position: fixed;
    top: 0;
    right: -300px; /* Hidden by default */
    width: 250px;
    height: 100%;
    background-color: var(--card-bg);
    z-index: 1002;
    box-shadow: -2px 0 10px var(--shadow-subtle);
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--header-total-height));
}

.side-menu.active {
    right: 0;
}



.side-menu .menu-header {
    width: 250px;
    height: var(--header-total-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--safe-top, var(--safe-top-fallback)) + 8px) 16px 8px 16px;
    background: linear-gradient(135deg, var(--current-theme-color, var(--primary-color)) 0%, var(--primary-color-dark) 100%);
    color: var(--secondary-color);
    box-shadow: 0 2px 8px var(--shadow-subtle);
    box-sizing: border-box;
}

.side-menu .menu-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
}

.side-menu .menu-header .close-menu-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.5rem;
    cursor: pointer;
    width: var(--header-height);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    border-radius: 0;
}

.side-menu .menu-header .close-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-list {
    list-style-type: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.menu-list li {
    padding: 0;
}

.menu-list a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-color);
    font-size: 1rem;
    transition: background-color 0.2s ease;
}



/* Keyframes for the header logo animation */
@keyframes wm-float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@keyframes slideText {
  0% {
    transform: translateX(-8px);
  }
  100% {
    transform: translateX(8px);
  }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .header-left .logo { animation: none; }
}

.menu-list a:hover {
    background-color: var(--light-gray);
}

.menu-divider {
    border-bottom: 1px solid var(--border-color);
    margin: 10px 0;
}

/* Profile Page */
.profile-info-card {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 20px;
}

.profile-info-card .profile-header {
    margin-bottom: 20px;
}

.profile-info-card .profile-pic-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px auto;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color);
}

.profile-info-card .profile-pic-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info-card h2 {
    margin: 0;
    font-size: 1.5rem;
}

.profile-info-card .role {
    color: var(--gray-text);
    font-weight: 400;
}

.profile-info-card .profile-details {
    text-align: left;
}

.profile-info-card .profile-details .info-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.profile-info-card .profile-details .info-item:last-child {
    border-bottom: none;
}
.profile-info-card .profile-details .info-item i {
    width: 30px;
    color: var(--primary-color);
}

.profile-info-card .profile-details .info-item span.value {
    color: var(--gray-text);
}

.profile-info-card .profile-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.profile-info-card .btn-secondary {
    padding: 10px 15px;
}

.profile-info-card .btn-secondary i {
    margin-right: 5px;
}

/* Chat Page Specific Styles */
.chat-list-container, .chat-window {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 10px;
}
.chat-list-container {
    gap: 15px;
}
.chat-window {
    background-color: var(--background-color);
}
.chat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--background-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}
.chat-item:hover {
    background-color: var(--light-gray);
}
.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}
.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.chat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.chat-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #000; /* Set user name color to black in chat list */
}
.chat-preview {
    font-size: 0.9rem;
    color: var(--gray-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-time {
    font-size: 0.8rem;
    color: var(--gray-text);
    flex-shrink: 0;
}
.hidden {
    display: none !important;
}




.messages-container {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.message {
    display: flex;
    align-items: flex-end;
}
.message-bubble {
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 80%;
    font-size: 0.9rem;
    line-height: 1.4;
}
.message.sent {
    justify-content: flex-end;
}
.message.sent .message-bubble {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border-top-right-radius: 5px;
}
.message.received {
    justify-content: flex-start;
}
.message.received .message-bubble {
    background-color: var(--light-gray);
    color: var(--text-color);
    border-top-left-radius: 5px;
}
.message-input-container {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
}
.message-input-container input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
}
.message-input-container button {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    min-height: var(--bottom-nav-height);
    padding-bottom: calc(var(--safe-bottom, var(--safe-bottom-fallback)) + 8px);
    background-color: var(--card-bg);
    box-shadow: 0 -2px 10px var(--shadow-subtle);
    overflow: visible;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    contain: layout style paint;
    transform-origin: 0 0;
}

/* Post Button - Floating Center Button (Zomato/Swiggy Style) */
.bottom-nav .nav-item-post {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -28px; /* Float above the navbar */
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1001;
    border: 3px solid var(--card-bg);
}

.bottom-nav .nav-item-post i {
    font-size: 1.5rem;
    margin: 0;
    color: #ffffff;
}

.bottom-nav .nav-item-post span {
    display: none !important; /* Hide text for post button */
}

.bottom-nav .nav-item-post:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bottom-nav .nav-item-post:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 3px 10px rgba(211, 47, 47, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Post button active state - keep the red gradient */
.bottom-nav .nav-item-post.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    color: #ffffff;
}

.bottom-nav .nav-item-post.active i {
    color: #ffffff;
}

/* Jab keyboard open hoga (screen height kam hogi), bottom-nav hide ho jaye */
@media (max-height: 400px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-text);
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.bottom-nav .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

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

.nav-item.active i {
    background-color: rgba(211, 47, 47, 0.1);
    padding: 8px 12px;
    border-radius: 15px;
    margin-bottom: 0px;
    color: var(--primary-color);
}

/* Profile Page - Own */
.profile-header-bg {
    background-color: var(--primary-color);
    height: 180px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.profile-info-card-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-top: 50px;
}

.profile-pic-container-home {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--card-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: 600;
    color: var(--primary-color);
    border: 3px solid var(--card-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 10px;
}

.profile-pic-container-home img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%; /* Ensures the image itself is rounded */
}

.profile-initials {
    line-height: 1;
}

.camera-icon, .upload-icon {
    background-color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: absolute;
}

.camera-icon {
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.upload-icon {
    bottom: -15px;
}

.profile-info-card-home h2 {
    font-size: 1.5rem;
    margin-top: 20px;
    margin-bottom: 5px;
}

.profile-info-card-home .role {
    color: var(--gray-text);
    font-size: 1rem;
    margin-bottom: 20px;
}

.profile-actions-home .edit-profile-btn {
    background-color: var(--secondary-color); /* White background */
    color: var(--primary-color); /* Red text */
    border: 1px solid var(--primary-color); /* Red border */
    text-decoration: none;
    padding: 10px 25px; /* Adjusted padding */
    border-radius: 12px; /* Softer corners */
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s;
}

.edit-profile-btn i {
    margin-right: 8px;
}

.profile-actions-home .edit-profile-btn:hover {
    background-color: rgba(211, 47, 47, 0.05); /* Slight red tint on hover */
}

/* Visitor Action Buttons Container */
.visitor-actions {
    display: none; /* Hidden by default, shown via JS */
    justify-content: center;
    gap: 10px;
    width: 100%;
}

/* Individual Visitor Action Button Style */
.profile-action-btn {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 10px 15px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1; /* Makes buttons equal width */
    max-width: 120px; /* Prevents buttons from becoming too wide */
    transition: background-color 0.2s ease;
}
.profile-action-btn:hover {
    background-color: var(--primary-color-dark);
}

.profile-details-home {
    width: 100%;
    max-width: 300px;
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-details-home .info-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gray-text);
    margin-bottom: 10px;
}

.profile-details-home .info-item i {
    margin-right: 10px;
    color: var(--primary-color);
}

.profile-stats-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 350px;
    background-color: var(--card-bg);
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-text);
    margin-top: 5px;
}

/* Tabbed Navigation Styles */
.profile-tabs {
    display: flex;
    justify-content: space-around;
    background-color: var(--card-bg);
    margin-top: 15px;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    color: var(--gray-text);
    cursor: pointer;
    transition: color 0.3s;
    flex-grow: 1;
}

.tab-button.active {
    color: var(--primary-color);
    font-weight: 500;
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}
/* --- Explore Page Filter Styles (New) --- */

.filter-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.filter-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.filter-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--background-color);
    cursor: pointer;
    color: var(--text-color);
}

.select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-text);
    pointer-events: none;
}

.apply-filters-btn {
    width: 100%;
    border-radius: 8px;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
/* body.modal-open ruleset removed - empty ruleset not allowed */

/* Ensure select dropdowns don't affect layout */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Ensure dropdowns don't create new stacking contexts that interfere */
    z-index: auto;
    /* Prevent layout shifts */
    box-sizing: border-box;
    transform: translateZ(0);
}

/* Prevent layout shifts when modals/dropdowns open */
.modal,
.dropdown,
.select-options {
    /* Ensure these don't affect document flow */
    position: fixed !important;
    /* Prevent any transforms that might cause layout shifts */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Mobile WebView keyboard handling */
@media screen and (max-width: 768px) {
  .chat-input-bar {
    /* Ensure input bar stays fixed when keyboard opens */
    position: fixed !important;
    bottom: 64px !important;
    /* Add safe area support for notched devices */
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
  }
  
  .chat-window {
    /* Adjust padding for mobile */
    padding-bottom: 100px; /* More space on mobile for input bar */
  }
  
  /* Ensure bottom nav stays fixed on mobile */
  .bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    z-index: 9999 !important;
  }
  
  /* Ensure modals stay below bottom nav on mobile */
  .modal,
  .dropdown,
  .select-options,
  .popup,
  .overlay {
    z-index: 1000 !important; /* Well below bottom nav */
  }
  
  /* Prevent layout shifts from form elements on mobile */
  select, input, textarea {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
}

.help-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* FAQ Accordion */
.faq-accordion {
    width: 100%;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--gray-text);
}

.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer p {
    margin: 0 0 15px 0;
    padding-left: 15px;
    color: var(--gray-text);
    font-size: 0.9rem;
}

/* Contact Section */
.contact-card {
    display: flex;
    flex-direction: column;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    color: var(--gray-text);
    margin-bottom: 10px;
}

.contact-info-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

.contact-info-item a {
    color: var(--text-color);
    transition: color 0.2s ease;
}

.contact-info-item a:hover {
    color: var(--primary-color);
}
/* --- About Us Page Styles --- */

.about-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 10px var(--shadow-subtle);
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.about-logo {
    width: 150px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
}

.social-links h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Update this entire social button styles section in your style.css */

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.social-btn.facebook {
    background-color: #3b5998;
}

.social-btn.instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.social-btn.whatsapp {
    background-color: #25d366;
}

.social-btn.youtube {
    background-color: #ff0000;
}


/* =============================================================== */
/* --- New Chat Page Design (Private Chat View) --- */
/* =============================================================== */

/* Messages page specific containers - prevent horizontal scrolling */
#chat-list-view {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

#chat-window-view {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

.chat-page-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--background-color); /* Light gray background for the whole page */
  /* Ensure proper viewport handling on mobile */
  height: 100dvh; /* Use dynamic viewport height for better mobile keyboard handling */
}


/* Header inside chat - replaced with Home header style above */
.chat-back{
  color:#fff;
  margin-right:15px;
  font-size: 1.2rem;
  text-decoration: none;
}
.chat-peer{ display:flex; align-items:center; gap:10px; flex:1; }
.chat-avatar{
  width:40px; height:40px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-weight:600;
  font-size: 1.2rem;
  border: 1px solid rgba(255,255,255,0.3);
}
.chat-meta{ display:flex; flex-direction:column; }
.chat-name{ font-size:1rem; font-weight: 600; margin:0; color:#000; }
.chat-status{ font-size:0.75rem; opacity:.85; color:#fff; }
.chat-actions a {
    color: #fff;
    font-size: 1.2rem;
    margin-left: 15px;
}

/* Main chat message area */
.chat-window {
  flex: 1; /* Takes up all available space */
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f9f9f9; /* Very light gray */
  /* Add bottom padding for fixed input bar */
  padding-bottom: 80px; /* 64px (input bar height) + 16px (margin) */
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.message.sent {
  align-self: flex-end;
  align-items: flex-end;
}

.message.received {
  align-self: flex-start;
  align-items: flex-start;
}

.message-bubble {
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 2px 4px rgba(0,0,0,0.07);
}

.message.sent .message-bubble {
  background: var(--primary-color);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.message.received .message-bubble {
  background: #fff;
  color: var(--text-color);
  border-bottom-left-radius: 6px;
}

.message .chat-time {
  font-size: 0.7rem;
  color: #999;
  margin-top: 4px;
  padding: 0 5px;
}

/* Fixed input bar above bottom nav - WhatsApp style */
.chat-input-bar{
  position: fixed;
  bottom: 64px;
  left: 0;
  right: 0;
  z-index: 1000; /* Above bottom nav (9999) but below modals (10000+) */
  display:flex;
  gap:8px;
  padding:10px;
  background:#fff;
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
  border-top: 1px solid var(--border-color);
  /* Ensure it stays above bottom nav but below modals */
  /* Add safe area support */
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
}
.chat-input-bar input{
  flex:1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 12px 18px;
  outline:none;
  font-size: 1rem;
}
.chat-input-bar .send-btn{
  border:0;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor:pointer;
  background: var(--primary-color);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: background-color 0.2s ease;
}
.chat-input-bar .send-btn:hover {
    background-color: var(--primary-color-dark);
}

.chat-empty{ text-align:center; color: var(--gray-text); padding: 24px 10px; }
.chat-empty i{ font-size:48px; opacity:.3; display:block; margin-bottom:10px; }
.hidden{ display:none; }
/* Messages page layout tune */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.review-author {
    font-weight: 600;
    color: var(--text-color);
}

.review-stars {
    color: #ffc107;
}

.review-text {
    color: var(--gray-text);
    font-size: 0.9rem;
    margin: 0;
}

/* Review Form */
.review-form {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.review-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    font-size: 1.8rem;
    color: #ccc; /* Default color for unselected stars */
    cursor: pointer;
    transition: color 0.2s;
}

/* Change color to yellow (#FFA500) on hover and when checked */
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: #FFA500; /* Yellow color for selected stars */
}

/* Ensure the checked stars are also yellow */
.star-rating-input input:checked + label ~ label {
    color: #FFA500;
}




/* Input Bar */
.message-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: #fff;
  border-top: 1px solid #ddd;
  position: sticky;
  bottom: 60px;   /* Bottom nav ka height */
  z-index: 10;
}

.message-input-container input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 10px 15px;
  outline: none;
  font-size: 0.9rem;
}

.message-input-container button {
  background: var(--primary-color);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

/* =============================================================== */
/* --- Location Permission Prompt Styles --- */
/* =============================================================== */

.location-permission-prompt {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(211, 47, 47, 0.02) 100%);
    border: 2px solid rgba(211, 47, 47, 0.1);
    border-radius: 16px;
    padding: 25px 20px;
    margin: 15px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.08);
    transition: all 0.3s ease;
}

.location-permission-prompt.show {
    animation: slideInFromTop 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.location-prompt-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.location-prompt-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.1) 0%, rgba(211, 47, 47, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.location-prompt-content h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
}

.location-prompt-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--gray-text);
    line-height: 1.4;
}

.location-prompt-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.allow-location-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    color: var(--secondary-color);
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(211, 47, 47, 0.2);
    flex: 1;
    max-width: 140px;
    justify-content: center;
}

.allow-location-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.3);
}

.allow-location-btn:active {
    transform: translateY(0);
}

.allow-location-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.skip-location-btn {
    background: transparent;
    color: var(--gray-text);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 120px;
}

.skip-location-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(211, 47, 47, 0.05);
}

.location-permission-status {
    font-size: 0.85rem;
    padding: 8px 15px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.location-permission-status.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.location-permission-status.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.location-permission-status.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.location-permission-status.info {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Location permission prompt responsive adjustments */
@media (max-width: 480px) {
    .location-permission-prompt {
        padding: 20px 15px;
        margin: 10px 0;
    }
    
    .location-prompt-content h3 {
        font-size: 1.1rem;
    }
    
    .location-prompt-content p {
        font-size: 0.9rem;
    }
    
    .location-prompt-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .allow-location-btn,
    .skip-location-btn {
        max-width: 100%;
    }
    
    .location-prompt-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* Dark mode support for location permission prompt */
body.dark-mode .location-permission-prompt {
    background: linear-gradient(135deg, #1e1e1e 0%, rgba(211, 47, 47, 0.05) 100%);
    border-color: rgba(211, 47, 47, 0.2);
}

body.dark-mode .location-prompt-content h3 {
    color: #ffffff;
}

body.dark-mode .location-prompt-content p {
    color: #cccccc;
}

body.dark-mode .skip-location-btn {
    border-color: #444444;
    color: #cccccc;
}

body.dark-mode .skip-location-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(211, 47, 47, 0.05);
}

/* Mobile Responsive Fixes */
@media (max-width: 480px) {
    .bottom-nav .nav-item span {
        display: none;
    }

    .listing-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .listing-card .listing-header {
        width: 100%;
    }

    .listing-card .meta {
        width: 100%;
    }

    .listing-card .listing-actions {
        flex-direction: row;
        padding-left: 0;
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
    }

    /* Modal adjustments for mobile */
    .popup {
        width: 95%;
        max-height: 90vh;
    }

    .modal-content {
        padding: 20px;
        gap: 16px;
    }

    .modal-content h2 {
        font-size: 1.3rem;
    }

    /* Edit Profile Modal mobile adjustments */
    #edit-profile-modal .modal-content {
        padding: 16px;
        gap: 12px;
    }

    #edit-profile-modal .modal-content h2 {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }

    #edit-profile-modal .modal-content #save-profile-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
}


/* =============================================================== */
/* --- Android WebView Compatibility Enhancements --- */
/* =============================================================== */

/* Enhanced safe-area top support for Android WebView in Kodular */
:root {
  /* Enhanced Android WebView Safe Area Support */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  
  /* Fallback values for older Android WebView versions */
  --safe-top-fallback: 24px;
  --safe-bottom-fallback: 0px;
  --header-h: 56px;
  --header-total-height: calc(var(--header-h) + var(--safe-top, var(--safe-top-fallback)));
}

/* Apply enhanced safe-area to all header elements */
header,
.app-header,
.notifications-header,
.chat-header {
  height: var(--header-total-height);
  padding-top: calc(var(--safe-top, var(--safe-top-fallback)) + 8px);
  padding-bottom: 8px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
  /* Use current theme color dynamically */
  background: linear-gradient(135deg, var(--current-theme-color, var(--primary-color)) 0%, var(--primary-color-dark) 100%);
}

/* Enhanced main content spacing for Android WebView */
.main-content {
  padding-top: 4px;
  padding-bottom: calc(var(--safe-bottom, var(--safe-bottom-fallback)) + var(--bottom-nav-height) + 20px);
}

/* Ensure proper alignment for all header elements */
.header-back-btn,
.header-title,
.back-button,
.back-icon,
.page-title {
  transform: translateY(6px);
  -webkit-transform: translateY(6px);
}

/* Responsive header height for different screen sizes */
@media (max-height: 640px) {
  :root { 
    --header-h: 48px; 
    --safe-top-fallback: 20px;
  }
}

@media (max-height: 480px) {
  :root { 
    --header-h: 44px; 
    --safe-top-fallback: 18px;
  }
}

/* Android WebView specific fixes */
@media screen and (max-width: 768px) {
  /* Ensure proper viewport handling on Android */
  html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }
  
  /* Fix for Android WebView scroll issues */
  body {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
  }
  
  /* Ensure headers don't overlap with system UI */
  header, .chat-header, .app-header {
    min-height: var(--header-total-height);
  }
}

/* Enhanced bottom navigation for Android WebView */
.bottom-nav {
  padding-bottom: calc(var(--safe-bottom, var(--safe-bottom-fallback)));
}

/* Force hardware acceleration for smooth scrolling on Android */
.main-content,
.chat-window,
.messages-container {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Android WebView specific touch optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets for mobile */
  .header-actions button,
  .nav-item,
  .listing-action-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Better touch feedback */
  button, .btn-primary, .btn-secondary {
    -webkit-tap-highlight-color: rgba(211, 47, 47, 0.1);
  }
}

/* =============================================================== */
/* --- Premium Refer a Friend Modal Styles --- */
/* =============================================================== */

.referral-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1002; /* Lower than bottom nav */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box;
}

.referral-modal.active {
    opacity: 1;
    visibility: visible;
}

.referral-modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.referral-modal.active .referral-modal-content {
    transform: scale(1) translateY(0);
}

.referral-modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    color: var(--secondary-color);
    padding: 25px 25px 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
}

.referral-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--secondary-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.referral-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.referral-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.referral-modal-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}

.referral-modal-body {
    padding: 25px;
}

.referral-hero {
    text-align: center;
    margin-bottom: 25px;
}

.referral-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.1) 0%, rgba(183, 28, 28, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2.5rem;
    color: var(--primary-color);
}

.referral-description {
    font-size: 1rem;
    color: var(--gray-text);
    line-height: 1.5;
    margin: 0;
}

.referral-link-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.referral-link-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.referral-link-label i {
    color: var(--primary-color);
}

.referral-link-text {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-color);
    word-break: break-all;
    margin-bottom: 15px;
    position: relative;
}

.referral-link-text.copied {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
    color: #28a745;
}

.referral-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.referral-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.referral-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.referral-btn-secondary {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.referral-btn-secondary:hover {
    background: rgba(211, 47, 47, 0.05);
    transform: translateY(-1px);
}

.referral-btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.referral-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.referral-btn i {
    font-size: 1.1rem;
}

.referral-success-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #28a745;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 15px;
    display: none;
}

.referral-success-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .referral-modal {
        padding: 15px;
    }
    
    .referral-modal-content {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .referral-modal-header {
        padding: 20px 20px 15px;
        border-radius: 16px 16px 0 0;
    }
    
    .referral-modal-title {
        font-size: 1.2rem;
    }
    
    .referral-modal-body {
        padding: 20px;
    }
    
    .referral-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        margin-bottom: 12px;
    }
    
    .referral-actions {
        gap: 10px;
    }
    
    .referral-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* Animation for button press feedback */
.referral-btn:active {
    transform: translateY(0);
}

.referral-btn-primary:active,
.referral-btn-whatsapp:active {
    transform: translateY(1px);
}


/* Ripple effect for buttons */
.referral-btn {
    position: relative;
    overflow: hidden;
}

.referral-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s;
    transform: translate(-50%, -50%);
}

.referral-btn:active::before {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
}

/* =============================================================== */
/* --- Dark Mode Toggle & Dark Mode Styles --- */
/* =============================================================== */

/* Toggle Switch Styles for Settings */
.toggle-switch {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-label {
  display: inline-block;
  width: 50px;
  height: 24px;
  background-color: var(--light-gray);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch:checked + .toggle-label {
  background-color: var(--primary-color);
}

.toggle-switch:checked + .toggle-label .toggle-slider {
  transform: translateX(26px);
}

/* Dark Mode Toggle Styles */
.dark-mode-toggle {
  margin-left: auto;
}

.dark-mode-item {
  cursor: default;
}

.dark-mode-item:hover {
  background-color: var(--card-bg);
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #121212;
  color: #ffffff;
}

body.dark-mode .card,
body.dark-mode .settings-card,
body.dark-mode .listing-card,
body.dark-mode .help-section-card,
body.dark-mode .about-card,
body.dark-mode .post-form-card,
body.dark-mode .profile-info-card {
  background-color: #1e1e1e;
  color: #ffffff;
}

body.dark-mode .text-color,
body.dark-mode .settings-item-title,
body.dark-mode .listing-card .listing-info h3,
body.dark-mode .listing-card .listing-info p {
  color: #ffffff;
}

body.dark-mode .gray-text,
body.dark-mode .settings-item-subtitle,
body.dark-mode .listing-card .listing-info .meta,
body.dark-mode .listing-meta .posted-ago,
body.dark-mode .listing-meta .listing-distance {
  color: #cccccc;
}

body.dark-mode .bottom-nav {
  background-color: #1e1e1e;
  border-top: 1px solid #333333;
}

/* Dark mode support for floating Post button */
body.dark-mode .bottom-nav .nav-item-post {
  background-color: #d32f2f;
  border-color: #1e1e1e;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .bottom-nav .nav-item-post:hover {
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .nav-item {
  color: #cccccc;
}

body.dark-mode .nav-item.active {
  color: var(--primary-color);
}

body.dark-mode .header-right .header-actions button {
  color: var(--secondary-color);
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
  background-color: #2a2a2a;
  border-color: #444444;
  color: #ffffff;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
  border-color: var(--primary-color);
}

body.dark-mode .search-bar {
  background-color: #1e1e1e;
  border-color: #444444;
}

body.dark-mode .search-bar input {
  color: #ffffff;
}


body.dark-mode .toggle-label {
  background-color: #444444;
}

body.dark-mode .toggle-slider {
  background-color: #cccccc;
}

/* Dark Mode Styles for Categories Grid and Filter Container */
body.dark-mode .categories-grid {
  background-color: #1e1e1e;
  border: 1px solid #333333;
}

body.dark-mode .category-item {
  color: #cccccc;
}

body.dark-mode .category-item i {
  background-color: rgba(211, 47, 47, 0.2);
  color: #ff6b6b;
}

body.dark-mode .filter-container {
  background-color: #1e1e1e;
  border: 1px solid #333333;
}

body.dark-mode .filter-group label {
  color: #ffffff;
}

body.dark-mode .filter-dropdown {
  background-color: #2a2a2a;
  border-color: #444444;
  color: #ffffff;
}


body.dark-mode .select-arrow {
  color: #cccccc;
}


/* Dark Mode Styles for Side Menu/Drawer */
body.dark-mode .side-menu {
  background-color: #1e1e1e;
  border-left: 1px solid #333333;
}

body.dark-mode .menu-list a {
  color: #ffffff;
  border-bottom: 1px solid #333333;
}

body.dark-mode .menu-list a:hover {
  background-color: #2a2a2a;
  color: #ffffff;
}

body.dark-mode .menu-divider {
  border-bottom-color: #333333;
}

body.dark-mode .dark-mode-item {
  color: #ffffff;
}

body.dark-mode .dark-mode-item:hover {
  background-color: #2a2a2a;
}
