/* === GLOBAL VARIABLES === */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #2d3436;
    --text-light: #636e72;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.2);
    --accent-color: #764ba2;
}

/* === RESET & BASICS === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    user-select: none; 
}

/* Allow selection in inputs */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Animated Background for "Alive" feel */
    background: linear-gradient(-45deg, #667eea, #764ba2, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    
    min-height: 100vh;
    color: var(--text-dark);
    padding-top: 80px; /* Space for fixed navbar */
    overflow-x: hidden; 
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === CUSTOM SCROLLBAR (High-end feel) === */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* === LOADER STYLES === */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
    text-align: center;
    animation: zoomInOut 2s infinite ease-in-out;
}

.loader-logo {
    width: 100px;
    height: 100px;
    background: var(--secondary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    font-weight: bold;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(118, 75, 162, 0.4);
}

.loader-text {
    font-size: 2em;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes zoomInOut {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

/* === NAVIGATION BAR === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    z-index: 1001;
}

.nav-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.nav-logo-text {
    font-size: 1.5em;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === MENU ITEMS === */
.nav-menu {
    display: flex;
    gap: 5px;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #555;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    -webkit-user-drag: none;
}

.nav-link:hover {
    background: rgba(118, 75, 162, 0.05);
    color: #764ba2;
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4);
    font-weight: 700;
    position: relative;
    z-index: 1;
    animation: activeGlow 0.3s ease-in-out;
}

@keyframes activeGlow {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(118, 75, 162, 0.2);
    }
    100% {
        transform: scale(1.08);
        box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4);
    }
}

.nav-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-item.open .nav-arrow {
    transform: rotate(180deg);
}

/* === DROPDOWNS === */
.dropdown-content {
    display: none; 
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    min-width: 260px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(0,0,0,0.05);
    animation: slideUpFade 0.2s ease forwards;
}

.dropdown-content.mega {
    min-width: 600px;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.nav-item.open .dropdown-content {
    display: block;
}

.nav-item.open .dropdown-content.mega {
    display: grid;
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    -webkit-user-drag: none;
    position: relative;
}

.dropdown-item:hover {
    background: #f5f7fa;
    color: #764ba2;
    padding-left: 20px; 
}

/* === ACTIVE SUBMENU ITEM STYLES === */
.dropdown-item.active {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(118, 75, 162, 0.35);
    font-weight: 700;
    padding-left: 20px;
    animation: submenuActiveGlow 0.3s ease-in-out;
    margin: 3px 0;
}

.dropdown-item.active:hover {
    transform: scale(1.05);
    padding-left: 20px;
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.45);
}

@keyframes submenuActiveGlow {
    0% {
        transform: scale(1);
        box-shadow: 0 3px 8px rgba(118, 75, 162, 0.2);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 6px 15px rgba(118, 75, 162, 0.35);
    }
}

/* Optional: Add a subtle indicator on the left side of active submenu items */
.dropdown-item.active::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 2px;
    opacity: 0.8;
}

.dropdown-category {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    font-weight: bold;
    margin: 10px 0 5px 15px;
    letter-spacing: 1px;
}

.mobile-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    z-index: 1001;
    padding: 10px;
}

/* === BANNER ADS (NEW) === */
.ad-banner {
    width: 95%;
    max-width: 728px; /* Leaderboard standard */
    height: 90px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    margin: 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    cursor: pointer;
}

.ad-banner:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.ad-banner span {
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* === HERO SECTION === */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
    color: white;
}

.hero h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-weight: 800;
}

.hero p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* === SEARCH BAR === */
.search-wrapper {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 22px 60px 22px 30px;
    border-radius: 50px;
    border: none;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    background: white;
}

.search-icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #667eea;
}

/* === GRID LAYOUT === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.category-section {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.category-title {
    color: white;
    font-size: 1.8em;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    /* Added alignment for flex items if they appear */
    justify-content: center;
}

/* === TOOL CARD === */
.tool-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 25px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    backdrop-filter: blur(10px);
    -webkit-user-drag: none;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    background: white;
    border-color: white;
}

.tool-icon {
    width: 55px;
    height: 55px;
    background: #f0f3f8;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-icon {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(118, 75, 162, 0.3);
}

.tool-content { flex: 1; }

.tool-name {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2d3436;
}

.tool-desc {
    font-size: 0.9em;
    color: #636e72;
    line-height: 1.5;
}

.badge-new {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(45deg, #00b894, #00cec9);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 184, 148, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 184, 148, 0); }
}

/* === FOOTER === */
footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 40px 20px;
    margin-top: 60px;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-col h3 {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: white;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary-gradient);
    border-radius: 2px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }

.footer-col a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.footer-col a:hover {
    color: white;
    transform: translateX(5px);
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9em;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(10px); }
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 968px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        transition: 0.3s ease;
        align-items: flex-start;
        overflow-y: auto;
        padding-bottom: 100px;
    }

    .nav-menu.active { left: 0; }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 20px 10px;
        font-size: 16px;
    }

    .nav-link.active {
        transform: scale(1.03);
        box-shadow: 0 5px 15px rgba(118, 75, 162, 0.3);
    }

    .dropdown-content, .dropdown-content.mega {
        position: static;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 15px;
        display: none;
        background: #f9f9f9;
        width: 100%;
        min-width: auto;
        max-height: none;
        grid-template-columns: 1fr !important;
        border: none;
        animation: none;
    }

    .nav-item.open .dropdown-content, 
    .nav-item.open .dropdown-content.mega {
        display: block !important;
    }

    .dropdown-item.active {
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
        margin: 5px 0;
    }

    .mobile-toggle { display: block; }
    .hero h1 { font-size: 2.2em; }
    .hero p { font-size: 1em; }
    
    .ad-banner {
        height: auto;
        padding: 20px;
        text-align: center;
    }
}