/* =====================================================
   RESPONSIVE SIDEBAR & LAYOUT STYLES - SHARED
   Used by: Category.cshtml, ClassifiedAds/Index.cshtml, SearchClassified.cshtml
   ===================================================== */

/* ===== CONTAINER & WRAPPER STYLES ===== */
.responsive-container {
    display: flex;
    gap: 20px;
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 15px;
}

.responsive-sidebar-wrapper {
    flex: 0 0 auto;
    width: 100%;
    max-width: 280px;
    transition: all 0.3s ease;
}

.responsive-main-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* ===== TOGGLE BUTTON STYLES ===== */
.responsive-sidebar-toggle {
    display: none;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.responsive-sidebar-toggle:hover {
    background: linear-gradient(135deg, #3a0ca3 0%, #2d0d8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.4);
}

.responsive-sidebar-toggle:active {
    transform: translateY(0);
}

.responsive-sidebar-toggle i {
    margin-right: 8px;
    font-size: 16px;
}

/* ===== RESULT HEADER STYLES ===== */
.result-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #4361ee;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.1);
}

.result-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #212529;
    font-weight: 600;
}

.result-header p {
    margin: 0;
    color: #757575;
    font-size: 14px;
}

/* ===== SIDEBAR CONTAINER STYLES ===== */
/* Main sidebar wrapper that holds the category sidebar */
.responsive-sidebar-wrapper .responsive-sidebar,
.responsive-sidebar-wrapper .category-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* ===== SIDEBAR INNER STYLES ===== */
/* Support both .responsive-sidebar and .category-sidebar classes */
.responsive-sidebar,
.category-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.responsive-sidebar .widget,
.responsive-sidebar .category-list-widget,
.category-sidebar .widget,
.category-sidebar .category-list-widget {
    border-bottom: 1px solid #eee;
    padding: 20px;
    margin: 0;
    display: block !important;
    visibility: visible !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
}

.responsive-sidebar .widget:last-child,
.responsive-sidebar .category-list-widget:last-child,
.responsive-sidebar .category-list-widget,
.category-sidebar .widget:last-child,
.category-sidebar .category-list-widget:last-child,
.category-sidebar .category-list-widget {
    border-bottom: none !important;
}

.responsive-sidebar .widget-header,
.category-sidebar .widget-header {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    border-bottom: 2px solid #4361ee;
    padding-bottom: 10px;
}

.responsive-sidebar .category-list,
.category-sidebar .category-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.responsive-sidebar .category-list li,
.category-sidebar .category-list li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    display: block;
}

.responsive-sidebar .category-list li a,
.category-sidebar .category-list li a {
    display: block !important;
    padding: 10px 12px !important;
    color: #757575 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    border: none !important;
    background: transparent !important;
}

.responsive-sidebar .category-list li a:hover,
.category-sidebar .category-list li a:hover {
    background: #f0f7ff !important;
    color: #4361ee !important;
    padding-left: 16px !important;
}

/* ===== GOOGLE ADS CONTAINER STYLES ===== */
.responsive-sidebar-wrapper #GoogleLeft,
.responsive-sidebar-wrapper .category-sidebar #GoogleLeft {
    border-top: solid 1px #ccc !important;
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: none !important;
}

#div-gpt-ad-1531038487920-0,
#div-gpt-ad-1531038487920-1 {
    margin-left: 0 !important;
    margin: 0 !important;
    padding: 10px !important;
    border: none !important;
}

.category-list-loading {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 14px;
    display: block !important;
    border-bottom: none !important;
}

.category-list-error {
    padding: 15px;
    color: #d32f2f;
    font-size: 14px;
    display: block !important;
    border-bottom: none !important;
}

/* Ensure the widget container is visible */
.category-list-widget {
    display: block !important;
    visibility: visible !important;
    overflow: visible !important;
    min-height: auto !important;
    height: auto !important;
    border-bottom: none !important;
}

/* Ensure the list is visible */
#Category {
    display: block !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    visibility: visible !important;
    overflow: visible !important;
}

#Category li {
    display: block !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    visibility: visible !important;
    overflow: visible !important;
}

#Category li a {
    display: block !important;
    visibility: visible !important;
    text-decoration: none !important;
    overflow: visible !important;
}

/* ===== RESPONSIVE MEDIA QUERIES ===== */

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
    .responsive-container {
        gap: 15px;
    }

    .responsive-sidebar-wrapper {
        max-width: 250px;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .responsive-container {
        flex-direction: column;
    }

    .responsive-sidebar-wrapper {
        max-width: 100%;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .responsive-sidebar-wrapper.active {
        max-height: 1000px;
        overflow: visible;
    }

    .responsive-sidebar-toggle {
        display: block;
    }

    .result-header {
        padding: 15px;
        margin-bottom: 20px;
    }

    .result-header h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .result-header p {
        font-size: 12px;
    }

    .responsive-main-content {
        padding: 0;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .responsive-container {
        padding: 0 10px;
        margin: 15px auto;
        gap: 10px;
    }

    .result-header {
        padding: 12px;
        border-left-width: 3px;
    }

    .result-header h2 {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .result-header p {
        font-size: 11px;
    }

    .responsive-sidebar .widget,
    .category-sidebar .widget {
        padding: 15px;
    }

    .responsive-sidebar .widget-header,
    .category-sidebar .widget-header {
        font-size: 14px;
        margin-bottom: 10px;
    }
}
