/* CSS VARIABLES */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #10b981;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}
/* Dropdown Container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Button */
.dropbtn {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--card-bg); /* Uses your existing variable */
    min-width: 200px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 1000;
    margin-top: 10px;
    padding: 10px 0;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

/* Links inside the dropdown */
.dropdown-content li {
    width: 100%;
}

.dropdown-content li a {
    color: var(--text-main);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: 0.2s;
}

/* Hover effect on dropdown links */
.dropdown-content li a:hover {
    background-color: var(--bg);
    color: var(--primary);
    padding-left: 25px; /* Slight slide effect */
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .dropdown-content {
        position: static;
        display: block; /* Show all links in mobile menu */
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 20px;
    }
    .dropbtn {
        font-weight: bold;
        color: var(--primary) !important;
    }
}

/* BASE STYLES */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    background: var(--bg); 
    color: var(--text-main); 
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

/* HEADER */
.sticky-header {
    background: rgba(var(--card-bg), 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}
.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.logo { font-size: 24px; font-weight: 800; color: var(--primary); }
.logo span { color: var(--text-main); }
.nav-links { display: flex; gap: 25px; }
.nav-links a:hover { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 15px; }
.search-box { position: relative; display: none; } /* Show on desktop */
@media (min-width: 1024px) { .search-box { display: block; } }

.search-box input {
    padding: 8px 15px 8px 35px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-main);
}
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }

/* HERO */
.hero-section { padding: 100px 0; text-align: center; background: linear-gradient(to bottom, var(--card-bg), var(--bg)); }
.hero-section h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 20px; }
.hero-section p { font-size: 1.25rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 30px; }

/* BUTTONS */
.btn { padding: 12px 28px; border-radius: 8px; font-weight: 600; cursor: pointer; display: inline-block; border: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }

/* TOOLS GRID */
.section-header { text-align: center; margin-bottom: 50px; }
.tools-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 25px; 
}
.tool-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}
.tool-card:hover { transform: translateY(-10px); border-color: var(--primary); }
.tool-icon { font-size: 40px; margin-bottom: 15px; }

/* BLOG GRID */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.post-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.post-img img { width: 100%; height: 200px; object-fit: cover; }
.post-content { padding: 20px; }
.post-tag { background: rgba(79, 70, 229, 0.1); color: var(--primary); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* ADS */
.ads-container { margin: 40px auto; }
.ad-box { 
    background: var(--border); 
    min-height: 100px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 8px; 
    color: var(--text-muted);
    font-size: 12px;
}

/* FOOTER */
footer { background: var(--card-bg); border-top: 1px solid var(--border); padding: 80px 0 20px; margin-top: 100px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 40px; }
.footer-col h4 { margin-bottom: 20px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-bottom { text-align: center; padding-top: 40px; border-top: 1px solid var(--border); margin-top: 40px; font-size: 14px; color: var(--text-muted); }

/* MOBILE NAVIGATION */
.mobile-menu-btn { display: none; font-size: 24px; cursor: pointer; }
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
}

/* BACK TO TOP */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--primary); color: white;
    width: 45px; height: 45px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    z-index: 100; cursor: pointer; border: none;
}