﻿/* MOBILE TOP BAR */
.mobile-top-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    background-color: white !important;
}

.mobile-logo {
    height: 28px !important;
    width: auto !important;
}

.mobile-logo-link {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

/* Fix search input and button to be same height */
.mobile-top-bar .input-group {
    height: 100% !important;
}

.mobile-top-bar .input-group-sm .form-control,
.mobile-top-bar .input-group-sm .btn {
    height: 36px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

.mobile-top-bar .input-group .btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.mobile-top-bar .input-group .form-control {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.mobile-top-bar .input-group .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* MOBILE BOTTOM NAV */
.mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1) !important;
    background-color: white !important;
}

.mobile-nav-item {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.mobile-nav-item small {
    font-size: 0.7rem !important;
    white-space: nowrap !important;
}

/* Remove borders from mobile nav buttons */
.mobile-nav-item .btn-link {
    border: none !important;
    text-decoration: none !important;
    background: none !important;
}

.mobile-nav-item .btn-link:focus,
.mobile-nav-item .btn-link:active,
.mobile-nav-item .btn-link:hover {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    background: none !important;
}

.mobile-avatar {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

/* Center the add button properly */
.mobile-add-btn {
    position: relative !important;
    top: -20px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex: 1 !important;
}

.add-article-circle {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #198754, #20c997) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.4) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.add-article-circle:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.5) !important;
}

.add-article-circle:active {
    transform: scale(0.95) !important;
}

/* Fix dropdown positioning for bottom nav */
.mobile-bottom-nav .dropdown-menu {
    position: absolute !important;
    bottom: 100% !important;
    top: auto !important;
    margin-bottom: 8px !important;
    transform: none !important;
}

/* Add padding to content to prevent overlap with fixed bars */
@media (max-width: 991.98px) {
    .layout-root {
        padding-top: 60px !important; /* Height of top bar */
        padding-bottom: 70px !important; /* Height of bottom nav */
    }
    
    /* Hide desktop elements */
    .search-bar-container {
        display: none !important;
    }
    
    .quick-categories-bar {
        display: none !important;
    }
}

/* DESKTOP SEARCH BAR */
.search-bar-container {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.nav-icon {
    color: #222;
}

.nav-icon:hover {
    color: #0d6efd;
}

@media (min-width: 1400px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 2000px;
    }
}

/*.search-bar-container .d-flex.align-items-center {
    max-width: 2000px;
}*/

/*FOR HOME PAGE*/
.ads-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.ad-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

    .ad-card:hover {
        transform: translateY(-3px);
    }

    .ad-card img {
        width: 100%;
        /*height: 180px;*/
        object-fit: cover;
    }

.ad-info {
    padding: 10px 12px;
}

@media (max-width: 768px) {
    .ads-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
}

.article-card-link:hover {
    cursor: pointer;
    opacity: 0.9;
}
/*FOR HOME PAGE*/

/*SINGLE ARTICLE*/
.article-container {
    max-width: 900px;
    /*margin: 0 auto;*/
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.image-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

    .image-slider img {
        width: 100%;
        height: 500px;
        object-fit: cover;
        border-radius: 8px;
    }

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    font-size: 24px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 50%;
}

    .slider-btn:hover {
        background: rgba(0,0,0,0.7);
    }

    .slider-btn.prev {
        left: 10px;
    }

    .slider-btn.next {
        right: 10px;
    }

.slider-dots {
    text-align: center;
    margin-top: 10px;
}

.dot {
    height: 10px;
    width: 10px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    margin: 0 3px;
    cursor: pointer;
}

    .dot.active {
        background-color: #009c74;
    }

.article-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111;
    margin: 15px 0;
    text-align: right;
}

.article-info h2 {
    margin-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.article-description textarea {
    width: 100%;
    height: 120px;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    font-size: 0.95rem;
    background-color: #f9f9f9;
}

.article-comments {
    margin-top: 30px;
}

.comment {
    background: #f6f6f6;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

.comment-time {
    font-size: 0.8rem;
    color: #777;
    margin-left: 8px;
}

.add-comment {
    display: flex;
    margin-top: 10px;
    gap: 10px;
}

    .add-comment input {
        flex: 1;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 8px;
    }

    .add-comment button {
        background: #009c74;
        color: white;
        border: none;
        border-radius: 5px;
        padding: 8px 15px;
        cursor: pointer;
    }
/*SINGLE ARTICLE*/

/*SELLER PROFILE*/
.seller-profile {
    display: flex;
    flex-direction: column; /* stack info and buttons vertically */
    gap: 1.5rem; /* space between seller-info and buttons */
    padding: 1rem;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
}

.seller-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ccc;
}

.seller-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

    .seller-details h3 {
        margin: 0;
        font-weight: 600;
    }

.online-status {
    font-size: 0.85rem;
    color: gray;
}

.badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f0f8ff;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #004080;
}

    .badge img {
        width: 20px;
        height: 20px;
    }

.response-time {
    background: #dbeeff;
    color: #004080;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    width: fit-content;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #004080;
    background: white;
    color: #004080;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
}

    .btn:hover {
        background-color: #004080;
        color: white;
    }

.phone-btn {
    /* phone button specific styles if needed */
}

.message-btn {
    /* message button specific styles if needed */
}

/* Responsive */
@media (max-width: 480px) {
    .seller-profile {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .seller-info {
        width: 100%;
        justify-content: flex-start;
    }

    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .btn {
        flex: 1 1 48%;
        justify-content: center;
    }
}

.article-main-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1200px; /* optional, set the maximum width */
    margin: 0 auto; /* horizontally center */
}

.article-container {
    flex: 1 1 65%; /* take 60% width or grow/shrink */
    min-width: 300px; /* prevent too small */
}

.seller-profile-container {
    flex: 0 0 32%;
    min-width: 280px;
    
}

@media (max-width: 1200px) {
    .article-main-container {
        flex-direction: column; /* stack article and seller profile vertically */
        gap: 1rem;
    }

    .article-container,
    .seller-profile-container {
        flex: 1 1 100%; /* full width on small screens */
        min-width: auto; /* allow shrinking */
    }
}
/*SELLER PROFILE*/

.search-bar-container, .navbar {
    padding-left: 22px;
    padding-right: 22px;
}

/* LOADER */
.loading-overlay {
    position: absolute; /* relative to .content-wrapper */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    z-index: 100; /* must be above inner content */
}

.loader {
    border: 6px solid #eee;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Autocomplete dropdown styling to match Bootstrap form controls */
.autocomplete-menu {
    position: fixed; /* Changed from absolute to fixed to break out of parent containers */
    z-index: 9999 !important;
    margin-top: 2px;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Width will be set via JavaScript to match input width */
    min-width: 200px;
}

.autocomplete-menu .autocomplete-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.375rem 0.75rem;
    border: none;
    background-color: #fff;
    color: #212529;
    font-size: 0.95rem;
    cursor: pointer;
}

.autocomplete-menu .autocomplete-item + .autocomplete-item {
    border-top: 1px solid #f1f3f5;
}

.autocomplete-menu .autocomplete-item.active,
.autocomplete-menu .autocomplete-item:hover {
    background-color: #f1f3f5;
    color: #212529;
}

/* Ensure parent containers don't clip the dropdown */
.card,
.card-body {
    overflow: visible !important;
}

.position-relative {
    overflow: visible !important;
}

/* Article Type Selection Styling */
.btn-check:checked + .btn-outline-primary {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.btn-outline-primary {
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.btn-outline-primary i {
    font-size: 1.1rem;
}