/* Fixed styles.css with duplicates removed and layout issues resolved */

/* Category List */
.category-list {
    padding: 0;
    list-style-type: none;
}

/* Category Items */
.category-item {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    transition: background-color 0.3s, box-shadow 0.3s;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
}

/* Hover Effect */
.category-item:hover {
    background-color: #e2e6ea;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    color: #007bff !important;
}

/* Style for Icons */
.category-icon {
    margin-right: 10px;
    font-size: 18px;
    color: #6c757d;
    transition: color 0.3s;
}

/* Change Icon Color on Hover */
.category-item:hover .category-icon {
    color: #007bff;
}

/* Active Category Styling */
.category-active {
    background-color: #007bff !important;
    color: white !important;
}

.category-active .category-icon {
    color: white !important;
}

/* Content Area - FIXED SINGLE RULE */
.content-area {
    margin-left: 0px;
}

/* Ensure the form is fully responsive */
@media (max-width: 768px) {
    .filter-select {
        min-width: 150px;
        font-size: 12px;
    }
}

/* Ensure all images in listing cards have the same width and height */
.card-img-top {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

/* Override Bootstrap link styles for category list */
.category-list a {
    text-decoration: none !important;
    color: #333 !important;
    display: flex;
    align-items: center;
}

/* Ensure the search button has enough space */
.search-button {
    width: auto;
    padding: 10px 20px;
    margin-right: 0;
    display: inline-block;
    box-sizing: border-box;
}

/* Ensure the container holding the search button is large enough */
.search-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

/* Adjust the width for the specific filter dropdown */
.filter-select {
    min-width: 300px;
    width: auto;
    font-size: 14px;
    padding: 10px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

/* Ensure the dropdown menu itself is wide enough */
.dropdown-menu {
    min-width: 250px;
}

/* General form control styling */
.form-control, .form-select {
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin-bottom: 15px;
}

/* Specific overrides for form-select */
.form-select {
    line-height: 1.5 !important;
    height: auto !important;
    padding: 8px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Enforce a maximum height for images inside the carousel */
.carousel-item img {
    max-height: 200px;
    object-fit: cover;
    width: 100%;
}

/* === FINAL TOPBAR NAVBAR STYLES === */

/* Ensure layout doesn't hide behind fixed navbar */
body {
    padding-top: 100px !important; /* ✅ Final override to fix overlap */
    overflow-y: auto !important;
}

/* Brand */
.navbar .navbar-brand {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar .navbar-brand i {
    margin-right: 8px;
}

/* Navigation Links */
.navbar .nav-link,
.navbar .btn-link {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    border-radius: 6px;
    padding: 10px 12px;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar .nav-link:hover,
.navbar .btn-link:hover {
    background-color: #f5f5f5;
    color: #007bff;
}

.navbar .nav-link i,
.navbar .btn-link i {
    margin-right: 6px;
    font-size: 16px;
    color: #6c757d;
}

.navbar .nav-link:hover i,
.navbar .btn-link:hover i {
    color: #007bff;
}

.navbar .nav-link.active {
    background-color: #007bff;
    color: white;
}

.navbar .nav-link.active i {
    color: white;
}

/* Language Dropdown */
.navbar select.form-select-sm {
    font-size: 14px;
    max-width: 180px;
}

/* Notification Badges */
.navbar .badge {
    font-size: 0.7rem;
    padding: 3px 6px;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .nav-link span,
    .navbar .btn-link span {
        display: none;
    }

    .navbar .navbar-brand strong {
        font-size: 16px;
    }

    .navbar {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Clean up leftovers */
body.sidebar-open {
    overflow: auto !important; /* prevent scroll lock from old sidebar */
}

.message-container {
    margin-top: 80px; /* Adjust to match the height of your navbar */
}

/* Let long category names wrap on multiple lines */
.list-group-item a {
    white-space: normal !important;
    word-break: break-word;
    flex-shrink: 1; /* make sure it doesn't push outside */
}

.category-icon {
    flex-shrink: 0;
}

/* ⭐ Favorites Button Styling */
.favorite-btn {
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    color: #333;
    position: relative;
    overflow: hidden;
}

.favorite-btn:hover {
    background-color: #e2e6ea;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.15);
}

.favorite-btn .heart-icon {
    font-size: 18px;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.favorite-btn:hover .heart-icon {
    transform: scale(1.2);
}

/* Loading state for favorites button */
.favorite-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.favorite-btn.loading .heart-icon {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Success animation for favorites */
.favorite-btn.success .heart-icon {
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* BOOTSTRAP GRID FIXES */
.row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: -15px !important;
    margin-right: -15px !important;
}

@media (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

.col-md-9 {
    flex: 0 0 75% !important;
    max-width: 75% !important;
}

.col-md-3 {
    flex: 0 0 25% !important;
    max-width: 25% !important;
}
