
/* Apply border-box for consistent box model */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Ensure html and body take full width and prevent horizontal overflow */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}


/* Main Container (if you have a wrapper div for the entire page content) */
.main-container {
    flex-grow: 1; /* Allow it to take available vertical space */
    display: flex;
    flex-direction: column;
}

/* Top Navigation Header */
.top-nav {
    background-color: #d1fae5; /* Light green background */
    color: #065f46; /* Dark green text color */
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle shadow */
    z-index: 50;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Space between logo and app name */
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Circular logo */
    object-fit: cover;
    border: 2px solid #34d399; /* Green border */
}

.app-name {
    font-size: 1.25rem; /* Larger font for app name */
    font-weight: 700; /* Bold */
    color: #065f46; /* Dark green color */
    text-decoration: none;
    transition: color 0.2s;
}

.app-name:hover {
    color: #10b981; /* Slightly darker green on hover */
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between icons */
}

.profile-dropdown-container {
    position: relative;
}

.profile-icon, .icon-button, .filter-button { /* Combined styles for clickable circular icons */
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: #34d399; /* Green background for icons */
    color: #ffffff; /* White icon color */
    cursor: pointer;
    transition: background-color 0.2s;
    border: none; /* Remove default button border */
}
.profile-icon:hover, .icon-button:hover, .filter-button:hover {
    background-color: #10b981; /* Darker green on hover */
}

.dropdown-menu {
 position: absolute;
    top: 50px; /* Position below the profile icon */
    right: 0; /* Align to the right of the profile icon */
    background-color: #ffffff; /* White background for dropdown */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 100;
    min-width: 180px;
}

/* This is the class your HTML is looking for to hide the menu */
.hidden {
    display: none !important;
}


.dropdown-menu a.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  color: #374151;
  transition: background-color 0.2s;
  font-size: 0.95rem;
}

.dropdown-menu a.dropdown-item:hover {
  background-color: #f0f2f5;
}

.dropdown-menu a.dropdown-item .icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  color: #6b7280;
}
/* Search and Filter Bar Section */
.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem; /* Add padding to the section itself */
    background-color: #f0f2f5; /* Match body background or keep it light */
}

.search-input-wrapper {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #9ca3af; /* Gray-400 */
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem; /* Left padding for icon */
    border: 1px solid #d1d5db; /* Gray-300 */
    border-radius: 24px; /* Rounded corners */
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: #6ee7b7; /* Green-300 */
    box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.4); /* Green shadow */
}

.filter-location-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* filter-button already styled above with .profile-icon, .icon-button */

.location-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.9rem;
    color: #374151; /* Gray-700 */
}
.location-display .distance {
    font-weight: 600;
    color: #10b981; /* Green-600 */
}

/* Categories Section */
.categories-section {
    padding: 0 1.5rem 1.5rem; /* Padding for left/right and bottom */
    background-color: #f0f2f5; /* Match body background or keep it light */
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.categories-scroll-wrapper {
    overflow-x: auto; /* Enable horizontal scrolling for categories */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding-bottom: 0.5rem; /* Space for scrollbar */
}

.categories-container {
    display: flex;
    gap: 0.75rem;
    padding-right: 1rem; /* Prevent last item from being cut off */
}

.category-button {
    background-color: #e0f2fe; /* blue-50 */
    color: #1e40af; /* blue-800 */
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap; /* Prevent text from breaking within a category */
    border: none; /* Remove default button border */
}

.category-button:hover {
    background-color: #bfdbfe; /* blue-200 */
    transform: translateY(-2px);
}

/* --- Service Cards (Newsfeed) --- */
.service-cards-section {
    padding: 0 1.5rem 2rem;
    flex-grow: 1;
}

.service-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.service-background-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.profile-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #fff;
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.profile-pic {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #34d399;
}

.service-caption {
    padding: 0.75rem;
    font-weight: 600;
    color: #111827;
    font-size: 1rem;
    text-align: center;
}

.item-details {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #374151;
    flex-grow: 1;
}

.item-details p {
    margin: 0.25rem 0;
}

/* --- Trade Button --- */
.actions {
    padding: 0.75rem 1rem 1rem;
    text-align: center;
}

.trade-btn {
    background-color: #34d399;
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
}

.trade-btn:hover {
    background-color: #10b981;
    transform: translateY(-2px);
}

.trade-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}


/* --- Vacation Mode Toggle --- */
.vacation-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.9rem;
    color: #374151; /* Tailwind gray-700 look */
}

/* Switch container */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

/* Hide the default checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider background */
.slider {
    position: absolute;
    cursor: not-allowed; /* kasi disabled sa homepage */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db; /* Tailwind gray-300 */
    transition: 0.4s;
    border-radius: 34px;
}

/* Slider circle */
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

/* When checked */
.switch input:checked + .slider {
    background-color: #34d399; /* green */
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

/* Rounded style */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}



/* --- Responsive --- */
@media (max-width: 768px) {
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Filter Modal Styling */
.filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.filter-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.filter-modal-content {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    max-width: 450px; /* Max width for the modal */
    width: 90%; /* Responsive width */
    text-align: left;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
}

.location-input-container,
.categories-dropdown-container {
    display: flex;
    align-items: center;
    background-color: #f0f2f5; /* Light gray background */
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
}

.location-input-container:hover,
.categories-dropdown-container:hover {
    background-color: #e5e7eb; /* Slightly darker gray on hover */
}

.location-icon, .categories-arrow {
    color: #6b7280; /* Gray-500 */
    margin-right: 0.75rem;
}

.location-text {
    flex-grow: 1;
    font-weight: 500;
}

.location-arrow {
    color: #6b7280; /* Gray-500 */
    margin-left: auto; /* Push to the right */
}

/* Distance Slider */
.distance-slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.distance-slider {
    flex-grow: 1;
    -webkit-appearance: none; /* Override default look */
    appearance: none;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

.distance-slider:hover {
    opacity: 1;
}

.distance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #34d399; /* Green thumb */
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.distance-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #34d399; /* Green thumb */
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.distance-value {
    font-weight: 600;
    color: #333;
    min-width: 60px; /* Ensure space for value */
    text-align: right;
}

/* Categories Dropdown */
.categories-dropdown {
    flex-grow: 1;
    background-color: transparent; /* Make it transparent to show parent background */
    border: none;
    outline: none;
    font-size: 1rem;
    font-weight: 500;
    padding-right: 2rem; /* Space for the custom arrow */
    -webkit-appearance: none; /* Remove default arrow */
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.categories-dropdown-container {
    position: relative; /* For custom arrow positioning */
}

.categories-dropdown-container .categories-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* Allow clicks to pass through to select */
}


.modal-buttons {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-buttons button {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    border: none; /* Remove default button border */
}

.clear-all-button {
    background-color: #e5e7eb; /* Gray-200 */
    color: #374151; /* Gray-700 */
}
.clear-all-button:hover {
    background-color: #d1d5db; /* Gray-300 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.apply-button {
    background-color: #34d399; /* Green-500 */
    color: #ffffff;
}
.apply-button:hover {
    background-color: #10b981; /* Green-600 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Custom Message Box Styles */
.custom-message-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    max-width: 300px;
    width: 90%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-nav {
        padding: 0.5rem 1rem;
    }
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem; /* Adjust padding for mobile */
    }
    .search-input-wrapper {
        width: 100%;
        margin-bottom: 1rem;
    }
    .filter-location-wrapper {
        width: 100%;
        justify-content: space-between; /* Distribute items */
    }
    .filter-button {
        flex: 0 0 auto; /* Don't grow/shrink, maintain size */
        border-radius: 8px; /* Make it a rectangle on mobile */
    }
    .location-display {
        flex-grow: 1; /* Allow it to take available space */
        align-items: flex-start; /* Align text to start */
    }
    .categories-section {
        padding: 0 1rem 1rem; /* Adjust padding for mobile */
    }
    .categories-scroll-wrapper {
        padding-bottom: 0; /* Remove extra padding if not needed */
    }
    .categories-container {
        flex-wrap: wrap; /* Allow categories to wrap to new lines */
        justify-content: center;
        padding-right: 0;
    }
    .category-button {
        flex: 0 0 auto; /* Don't grow/shrink, maintain size */
    }
    .service-cards-section {
        padding: 0 1rem 1rem; /* Adjust padding for mobile */
    }
    .service-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Smaller cards on mobile */
    }
    .filter-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}


/* Modal overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

/* Modal content */
.modal-content {
    position: relative; /* para gumana yung absolute ng close button */
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Close button (X) */
.modal-content .close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;  /* malaki */
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-content .close:hover {
    color: #000;
}

/* Modal title */
.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* Stars */
.stars {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.star {
    font-size: 40px; /* make it bigger */
    color: #ccc;     /* default gray */
    cursor: pointer;
    transition: color 0.2s;
}

.star.selected,


/* Submit button */
#submitRating {
    background-color: #34d399; /* Green-500 */
    color: #fff;
    border: none;
    padding: 10px 25px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}


/* Dropdown (if used elsewhere) */
.categories-dropdown {
    flex-grow: 1;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.categories-dropdown:hover,
.categories-dropdown:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
    outline: none;
}
/* --- BASIC FONT STYLE FOR HOMEPAGE --- */
body, 
h1, h2, h3, h4, h5, h6, 
p, span, a, label, input, button, div, section, article, .service-caption, .item-details, .location-display, .category-button, .modal-title, .filter-label, .distance-value {
    font-family: Arial, Helvetica, sans-serif; /* Basic, casual font */
    font-style: normal; /* Remove italics */
    font-weight: normal; /* Remove bold unless specified separately */
}

/* Optional: slightly larger text for readability */
body {
    font-size: 16px;
    color: #111; /* Dark gray text for better contrast */
}

/* Override headings if you want them still bigger but casual */
h1, h2, h3, h4, h5, h6 {
    font-weight: bold; /* headings can stay bold */
    font-family: Arial, Helvetica, sans-serif;
}

/* Keep icon buttons untouched */
.profile-icon, .icon-button, .filter-button {
    font-family: inherit; /* keep original icon font if any */
}

.modal-content.wide {
    max-width: 800px;  /* mas malapad */
    width: 90%;
    text-align: left;
    padding: 20px;
}
