/* ============================================ */
/* AUTO-HIDE ADS WHEN NOT PRESENT (MOBILE) */
/* ============================================ */

.top-ad-container:empty,
.bottom-ad-container:empty {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
}

/* ============================================ */
/* MOBILE RESPONSIVE - PROFESSIONAL EDGE TO EDGE BOX */
/* ============================================ */

/* Hide mobile-only classes agar koi hain */
.mobile-only {
    display: none !important;
}

/* Tablet (992px se neeche) */
@media (max-width: 992px) {
    .tool-grid {
        grid-template-columns: repeat(4, minmax(90px, 150px));
        gap: 12px;
        padding: 15px;
    }
}

/* Mobile (768px se neeche) - Edge to Edge Box */
@media (max-width: 768px) {
    /* Tool Grid - 2 columns */
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
    
    .tool-grid li {
        aspect-ratio: auto;
        min-height: 100px;
    }
    
    .tool-grid li a {
        padding: 12px 8px;
    }
    
    .tool-grid li a .tool-title {
        font-size: 12px;
    }
    
    .tool-grid li a .tool-desc {
        font-size: 10px;
    }
    
    .tool-grid li a i {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    /* ===== PROFESSIONAL BUTTON BOX - EDGE TO EDGE ===== */
    .heading-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 16px 12px;
        margin: 0;
        width: 100%;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-top: 1px solid #e2e8f0;
        border-bottom: 1px solid #e2e8f0;
        box-sizing: border-box;
    }
    
    /* Buttons - 3 per line, button color WAISE HI RAHEGA (PC jaisa) */
    .heading-bar button {
        flex: 1 1 auto;
        min-width: calc(33.33% - 8px);
        max-width: calc(33.33% - 8px);
        padding: 10px 4px !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        border-radius: 30px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        /* COLOR: PC wala hi color use hoga - koi change nahi */
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
    }
    
    /* Active/Tap effect */
    .heading-bar button:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
    
    /* Site description */
    .site-description {
        font-size: 14px;
        padding: 0 15px;
        text-align: center;
    }
    
    h2 {
        font-size: 18px;
        text-align: center;
        padding: 0 10px;
    }
}

/* Small Mobile (480px se neeche) - 2 buttons per line */
@media (max-width: 480px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .tool-grid li a {
        padding: 8px 4px;
    }
    
    .tool-grid li a .tool-title {
        font-size: 11px;
    }
    
    .tool-grid li a .tool-desc {
        font-size: 9px;
    }
    
    .tool-grid li a i {
        font-size: 20px;
    }
    
    /* Small mobile par 2 buttons per line */
    .heading-bar {
        gap: 8px;
        padding: 12px 10px;
    }
    
    .heading-bar button {
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
        padding: 10px 4px !important;
        font-size: 11px !important;
        border-radius: 30px !important;
    }
}

/* Extra Small (380px se neeche) */
@media (max-width: 380px) {
    .heading-bar {
        gap: 6px;
        padding: 10px 8px;
    }
    
    .heading-bar button {
        min-width: calc(50% - 6px);
        max-width: calc(50% - 6px);
        padding: 8px 4px !important;
        font-size: 10px !important;
    }
}

/* Desktop par mobile UI force hide */
@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}