/* =================================================================
   ALGODELTA PRO - MOBILE RESPONSIVE RULES (Mobile Only)
   ================================================================= */

@media only screen and (max-width: 768px) {
    
    /* 1. SEARCH PAGE RESPONSIVE FIX */
    #bbp-search-results .ledger-header {
        display: none !important; /* Mobile par table header chupana zaroori hai */
    }

    #bbp-search-results .ledger-row {
        flex-direction: column !important; /* Stack items vertically */
        align-items: flex-start !important;
        padding: 15px !important;
        margin-bottom: 10px;
        border-bottom: 1px solid #333;
    }

    /* Column Widths Reset */
    #bbp-search-results .col-name, 
    #bbp-search-results .col-stat, 
    #bbp-search-results .col-last {
        width: 100% !important;
        text-align: left !important;
        padding: 5px 0 !important;
    }

    /* Add Labels for Context on Mobile */
    #bbp-search-results .col-stat::before {
        content: "Type: ";
        color: #666;
        font-size: 12px;
        margin-right: 5px;
    }
    
    #bbp-search-results .col-last::before {
        content: "Last Updated: ";
        color: #666;
        font-size: 12px;
        margin-right: 5px;
    }

    /* 2. FORUM GRID FIX (1 Column) */
    .algo-grid-container {
        grid-template-columns: 100% !important; /* Full Width Column */
        display: block !important; /* Grid fallback */
    }

    .algo-forum-card {
        margin-bottom: 20px !important;
        width: 100% !important;
    }

    /* 3. MAIN CONTAINER PADDING */
    .site-main, #primary, #content {
        padding: 10px !important;
        width: 100% !important;
        float: none !important;
        overflow-x: hidden !important;
    }

    /* 4. SIDEBAR FIX */
    #secondary {
        width: 100% !important;
        float: none !important;
        padding: 20px 15px !important;
        border: none !important;
        border-top: 1px solid #222 !important;
        margin-top: 30px !important;
    }

    /* 5. SEARCH BAR ADJUSTMENT */
    .algo-search-wrapper {
        padding: 5px !important;
        flex-wrap: wrap; /* Content wrap allow karein */
        height: auto !important; /* Height auto karein taaki content fit ho */
    }
    
    .search-icon {
        display: none; /* Space bachane ke liye icon chupayein */
    }

    #bbp_search {
        font-size: 14px !important;
        width: 70% !important; /* Input ko jagah dein */
    }

    .algo-search-btn {
        width: 25% !important; /* Button size */
        padding: 0 5px !important;
        font-size: 12px !important;
        margin-left: 0 !important;
    }

    /* 6. TOPIC LEDGER MOBILE */
    .ledger-header { display: none !important; }
    
    .ledger-row { 
        flex-direction: column; 
        align-items: flex-start; 
        padding: 15px; 
    }
    
    .col-name { width: 100%; margin-bottom: 10px; }
    
    .col-stat, .col-last { 
        width: 100%; 
        text-align: left; 
        font-size: 12px;
        color: #888;
        display: flex;
        justify-content: space-between; /* Label left, Value right */
        border-bottom: 1px solid #1a1a1a;
        padding-bottom: 5px;
        margin-bottom: 5px;
    }

    /* Mobile Labels for Topics */
    .col-stat.num::before { content: "Stats:"; color: #555; }
    .col-last.date::before { content: "Last Active:"; color: #555; }

    /* 7. PAGINATION MOBILE */
    .bbp-pagination-links {
        gap: 5px;
    }
    .bbp-pagination-links .page-numbers {
        width: 35px; height: 35px; font-size: 14px; padding: 0;
    }
    .bbp-pagination-links .next, 
    .bbp-pagination-links .prev {
        font-size: 10px; padding: 0 10px; width: auto;
    }
}