/* css/sidebar.css */

/* === SIDEBAR CONTENT === */
.sidebar {
    width: 100%;
    background: #fff;
    height: 100%;
}

/* Widgets */
.sidebar-widget {
    background: #fff;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-widget:last-child {
    border-bottom: none;
}

.sidebar-widget h3 {
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.sidebar-widget .icon-spacing {
    margin-right: 10px;
    color: var(--accent-color);
}

/* Search */
.search-form {
    display: flex;
    position: relative;
}

.search-form input[type="text"] {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #eee;
    border-radius: 20px;
    outline: none;
    transition: border 0.3s;
}

.search-form input[type="text"]:focus {
    border-color: var(--accent-color);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Categories */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 6px 0;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.category-list a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.category-list a.active {
    color: var(--accent-color);
    font-weight: bold;
}

/* Subcategories */
.sub-category-list {
    list-style: none;
    padding: 0 0 0 15px;
    margin: 5px 0 10px 0;
    border-left: 2px solid #f0f0f0;
}

.sub-category-list a {
    font-size: 0.85rem;
    color: #777;
    padding: 4px 0 4px 10px;
}

.sub-category-list a.active {
    color: var(--accent-color);
    font-weight: bold;
}

/* Filters */
.filter-group {
    margin-bottom: 15px;
}

.filter-group h4 {
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    color: #777;
    text-transform: uppercase;
}

.filter-options {
    max-height: 200px;
    overflow-y: auto;
}

.filter-options label {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-options input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--accent-color);
}

.post-ad-btn {
    width: 100%;
    padding: 10px;
    background: #333742;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* === BANNERS === */
.banner-widget {
    padding: 0;
    border: none;
}

.banner-link {
    display: block;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.sidebar-banner-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.banner-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    text-align: center;
}

.banner-title {
    font-size: 0.9rem;
    font-weight: bold;
}

/* === MOBILE DRAWER LOGIC (FIXED) === */
.sidebar #sidebarToggleClose {
    display: none; 
}

@media (max-width: 900px) {
    .layout-sidebar {
        display: block !important; 
        position: fixed;
        top: 0;
        left: 0;
        width: 80%; 
        max-width: 300px; 
        height: 100vh;
        z-index: 2000;
        overflow-y: auto;
        background: #fff;
        box-shadow: 4px 0 10px rgba(0,0,0,0.2);
        
        /* Transform Logic for smoother animation */
        transform: translateX(-100%);
        visibility: hidden; /* Hide completely when closed */
        transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
    }

    /* Active State */
    .layout-sidebar.active {
        transform: translateX(0);
        visibility: visible;
    }

    .sidebar #sidebarToggleClose {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 10px;
        background: #f8f9fa;
        color: #333;
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 20px;
        cursor: pointer;
        font-weight: bold;
        justify-content: center;
    }
    
    .sidebar #sidebarToggleClose i {
        margin-right: 8px;
        color: var(--accent-color);
    }

    /* Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1500;
        
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}