/* ============================================
   FINAL CSS - 5 BOXES PER ROW, CENTERED (PC ONLY)
   ============================================ */

/* ============================================ */
/* ✅ BORDER STYLES FOR TOOL BOXES */
/* ============================================ */

/* Default: No border, will be set by classes */
.tool-grid li {
    border: none !important;
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* All Sides */
.border-all .tool-grid li {
    border: 2px solid var(--primary-color, #667eea) !important;
}

/* Top Only */
.border-top .tool-grid li {
    border: 2px solid transparent !important;
    border-top: 4px solid var(--primary-color, #667eea) !important;
}

/* Bottom Only */
.border-bottom .tool-grid li {
    border: 2px solid transparent !important;
    border-bottom: 4px solid var(--primary-color, #667eea) !important;
}

/* Left Only */
.border-left .tool-grid li {
    border: 2px solid transparent !important;
    border-left: 4px solid var(--primary-color, #667eea) !important;
}

/* Right Only */
.border-right .tool-grid li {
    border: 2px solid transparent !important;
    border-right: 4px solid var(--primary-color, #667eea) !important;
}

/* Top & Bottom */
.border-top-bottom .tool-grid li {
    border: 2px solid transparent !important;
    border-top: 4px solid var(--primary-color, #667eea) !important;
    border-bottom: 4px solid var(--primary-color, #667eea) !important;
}

/* Left & Right */
.border-left-right .tool-grid li {
    border: 2px solid transparent !important;
    border-left: 4px solid var(--primary-color, #667eea) !important;
    border-right: 4px solid var(--primary-color, #667eea) !important;
}

/* ============================================ */
/* EXISTING STYLES (UNCHANGED) */
/* ============================================ */

/* HEADER */
.heading-bar {
    display: flex;
    gap: 5px;
    padding: 15px;
    overflow-x: auto;
    justify-content: center;
    flex-wrap: wrap;
}

.heading-bar::-webkit-scrollbar {
    display: none;
}

.heading-bar button {
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    border: none;
    transition: all 0.3s ease;
    background: var(--main-color, #007bff);
}

.heading-bar button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* TOOL BOX */
.tool-box {
    display: none;
    width: 100%;
    max-width: 1200px;
    margin: 15px auto;
    background: var(--card-bg, #fff);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #eee);
}

.tool-box.show {
    display: block;
}

body {
    padding-top: 50px;
}

.site-title {
    text-align: center;
    margin-top: 7px;
}

.site-description {
    text-align: center;
    max-width: 800px;
    margin: 10px auto;
    font-size: 18px;
    color: var(--text-muted, #666);
    line-height: 1.2;
}

/* ============================================
   MAIN GRID - RESPONSIVE (PC & MOBILE FIX)
   ============================================ */

/* Make all tool containers transparent */
[id^="tools"] {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 30px 0 !important;
    display: flex;
    justify-content: center;
}

/* Grid Container - Responsive */
.tool-grid {
    display: grid;
    /* PC par 5 columns, Mobile par automatic adjust hoga */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 15px;
    padding: 15px;
    list-style: none;
    margin: 0 auto;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
}

/* Boxes */
.tool-grid li {
    aspect-ratio: 1 / 1; /* Square shape */
    position: relative;
    background: var(--card-bg, rgba(255, 255, 255, 0.95));
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    overflow: hidden; /* Text bahar nikalne se rokega */
}

/* Link Styling */
.tool-grid li a {
    color: var(--text-color, #333);
    text-decoration: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    z-index: 1;
}

/* Icon Styling (FIX) */
.tool-grid li a i {
    font-size: 32px; /* Icon ka size fix kiya */
    margin-bottom: 8px;
    display: block;
}

/* Title Styling */
.tool-grid li a .tool-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #333);
    margin-bottom: 4px;
    display: block;
    line-height: 1.2;
}

/* Description Styling */
.tool-grid li a .tool-desc {
    font-size: 11px;
    color: var(--text-muted, #666);
    line-height: 1.2;
    display: block;
}

/* Hover Effects */
.tool-grid li:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ===== MOBILE SPECIFIC FIX ===== */
@media (max-width: 768px) {
    /* Mobile par 2 columns dikhayega */
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .tool-grid li a i {
        font-size: 28px; /* Mobile par icon thoda chota */
    }

    .tool-grid li a .tool-title {
        font-size: 12px;
    }

    .tool-grid li a .tool-desc {
        font-size: 9px;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Sirf 2 lines dikhayega */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Heading ka size mobile par fix karein */
    h1 {
        font-size: 24px !important;
        padding: 0 15px;
    }
    .site-description {
        font-size: 14px;
        padding: 0 15px;
    }
}