/* --- 1. VARIABLES & RESET --- */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --radius: 16px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* --- 2. NAVBAR --- */
.navbar {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.navbar-brand { font-weight: 800; color: var(--dark); font-size: 1.5rem; letter-spacing: -0.5px; }
.nav-link { font-weight: 600; color: var(--secondary); margin: 0 10px; transition: 0.3s; }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.dropdown-menu { border: none; box-shadow: 0 10px 40px rgba(0,0,0,0.1); border-radius: 12px; padding: 10px; }
.dropdown-item { border-radius: 8px; padding: 8px 15px; font-weight: 500; color: var(--secondary); }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }

/* --- 3. HERO SECTION --- */
.hero-section {
    padding: 100px 0 80px;
    text-align: center;
    background: radial-gradient(circle at top right, #e0e7ff 0%, transparent 40%),
                radial-gradient(circle at bottom left, #e0e7ff 0%, transparent 40%);
}
.hero-title { font-size: 3.5rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 20px; background: linear-gradient(135deg, #1e293b 0%, #4f46e5 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 1.25rem; color: var(--secondary); max-width: 600px; margin: 0 auto 40px; line-height: 1.6; }

/* Search Box */
.search-wrapper { position: relative; max-width: 500px; margin: 0 auto; }
.search-input { width: 100%; padding: 20px 25px 20px 55px; border-radius: 50px; border: 2px solid transparent; background: var(--white); box-shadow: 0 10px 40px rgba(79, 70, 229, 0.1); font-size: 1.1rem; transition: 0.3s; outline: none; }
.search-input:focus { border-color: var(--primary); box-shadow: 0 10px 40px rgba(79, 70, 229, 0.2); }
.search-icon { position: absolute; left: 25px; top: 50%; transform: translateY(-50%); color: var(--secondary); font-size: 1.2rem; }

/* --- 4. CATEGORY HEADERS --- */
.cat-group { margin-bottom: 60px; scroll-margin-top: 100px; }
.cat-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 30px; display: flex; align-items: center; gap: 15px; color: var(--dark); }
.cat-icon-box { width: 45px; height: 45px; background: var(--primary); color: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* --- 5. TOOL CARDS --- */
.tool-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.tool-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: var(--primary-light); }
.tool-icon { font-size: 2.5rem; margin-bottom: 20px; transition: 0.3s; }
.tool-card:hover .tool-icon { transform: scale(1.1); }
.icon-blue { color: #4f46e5; }
.icon-yellow { color: #f59e0b; }
.icon-green { color: #10b981; }

.tool-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; color: var(--dark); }
.tool-desc { color: var(--secondary); font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; flex-grow: 1; }

.btn-fancy {
    display: inline-block;
    padding: 8px 0;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    position: relative;
}
.btn-fancy::after { content: '→'; margin-left: 5px; transition: 0.3s; }
.btn-fancy:hover::after { margin-left: 10px; }

/* --- 6. PAGE HEADER (For About, Contact etc) --- */
.page-header {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    padding: 80px 0 60px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 60px;
}
.page-title { font-weight: 800; color: #1e293b; font-size: 2.5rem; margin-bottom: 10px; }
.breadcrumb { justify-content: center; color: var(--secondary); font-size: 0.95rem; }
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 600; margin: 0 5px; }

/* --- 7. FOOTER --- */
.main-footer { background: #0f172a; color: white; padding: 80px 0 30px; margin-top: auto; }
.footer-col h5 { font-weight: 700; margin-bottom: 25px; color: white; }
.footer-col a { display: block; color: #94a3b8; margin-bottom: 12px; transition: 0.3s; text-decoration: none; }
.footer-col a:hover { color: white; padding-left: 5px; }
.copyright { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px; text-align: center; color: #64748b; font-size: 0.9rem; margin-top: 50px; }

/* --- 8. MOBILE OPTIMIZATION (2 Columns) --- */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    
    /* Force Grid to 2 Columns */
    .row.g-4 > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 6px;
        padding-right: 6px;
    }

    /* Compact Card Design for Mobile */
    .tool-card {
        padding: 15px;
        min-height: 200px;
        border-radius: 12px;
    }
    .tool-icon { font-size: 2rem; margin-bottom: 10px; }
    .tool-name { font-size: 0.95rem; line-height: 1.3; margin-bottom: 5px; }
    .tool-desc { 
        font-size: 0.75rem; 
        line-height: 1.4; 
        margin-bottom: 10px;
        /* Truncate text after 3 lines */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden; 
    }
    .btn-fancy { font-size: 0.8rem; }
    
    /* Fix Container Padding */
    .container { padding-left: 12px; padding-right: 12px; }
    .cat-title { font-size: 1.4rem; margin-bottom: 20px; }
}