:root {
    --bg: #f5f5f9;
    --card: #fff;
    --ink: #1d1f22;
    --sub: #61656b;
    --brand: #6c4eff;
    --brand-hover: #5848c2;
    --focus: #ffb347;
    --border: #e1e4e8;
    --shadow: 0 2px 20px rgba(0,0,0,.06);
    --radius: 12px;
    --radius-sm: 6px;
    --page-max: 1080px;
    --card-max: 860px;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body.dark-theme {
    --bg: #151519;
    --card: #1e1e24;
    --ink: #f1f3f5;
    --sub: #a0a4aa;
    --border: #383840;
    --shadow: 0 2px 20px rgba(0,0,0,.2);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header and Navigation */
header {
    background: var(--card);
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 0;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--brand);
    gap: .55rem;
}

.logo img {
    height: 28px;
    width: auto;
}

.nav-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 1rem;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.dropdown-toggle:hover, 
.dropdown-toggle:focus {
    border-color: var(--brand);
    color: var(--brand);
}

.dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.dropdown-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    min-width: 180px;
    z-index: 100;
    display: none;
    margin-top: 0.3rem;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--sub);
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: rgba(0,0,0,.05);
    color: var(--brand);
}

body.dark-theme .dropdown-menu a:hover {
    background: rgba(255,255,255,.05);
}

/* Theme Toggle */
.theme-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s, background-color .2s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(0,0,0,.05);
    color: var(--brand);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: inline-block;
}

body.dark-theme .theme-toggle .fa-sun {
    display: inline-block;
}

body.dark-theme .theme-toggle .fa-moon {
    display: none;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: clamp(1.9rem, 4vw, 2.45rem);
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--brand);
}

.hero p {
    color: var(--sub);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(0,0,0,.1);
}

.feature-card i {
    font-size: 1.8rem;
    color: var(--brand);
    margin: 0.3rem 0;
}

.feature-card h3 {
    margin: .2rem 0;
    font-size: 1.1rem;
    color: var(--brand);
    font-weight: 600;
}

.feature-card p {
    color: var(--sub);
    font-size: 0.9rem;
    margin-top: 0;
}

/* Section Titles */
.section-title {
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    padding-top: 2rem;
}

.section-title h2:after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--brand);
    margin: 0.7rem auto 0;
    border-radius: 2px;
    opacity: 0.8;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.tool-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(0,0,0,.1);
}

.tool-card-content {
    margin-bottom: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-card i {
    font-size: 2rem;
    color: var(--brand);
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin: 0 0 0.6rem;
    color: var(--ink);
}

.tool-card p {
    color: var(--sub);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.tool-card a {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background .2s, transform .1s;
    border: 1px solid var(--brand);
}

.tool-card a:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

.tool-card a:active {
    transform: translateY(1px);
}

/* Categories */
.categories {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.category-title:after {
    content: '';
    display: block;
    width: 40%;
    height: 2px;
    background: var(--brand);
    margin-top: 0.3rem;
    border-radius: 2px;
    opacity: 0.8;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.2rem 1rem;
    text-align: center;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,.1);
    border-color: var(--brand);
}

.category-card i {
    font-size: 1.8rem;
    color: var(--brand);
    margin-bottom: 0.6rem;
}

.category-card h4 {
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
    color: var(--ink);
}

.category-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

/* Footer */
footer {
    background: var(--card);
    padding: 1.8rem 0;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.footer-links {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: var(--sub);
}

.footer-links a {
    color: var(--sub);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--brand);
}

.footer-copyright {
    text-align: center;
    font-size: 0.85rem;
    color: var(--sub);
}

/* About Section */
.about-section {
    margin: 3rem 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.about-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: left;
    transition: transform .2s, box-shadow .2s;
}

.about-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(0,0,0,.1);
}

.about-card h3 {
    color: var(--brand);
    font-size: 1.3rem;
    margin: 0 0 1rem;
    font-weight: 600;
    text-align: center;
}

.about-card h4 {
    color: var(--ink);
    font-size: 1.1rem;
    margin: 1.5rem 0 0.8rem;
    font-weight: 600;
}

.about-card p {
    color: var(--sub);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.about-card p:last-child {
    margin-bottom: 0;
}

/* Ad Spaces */
.ad-space {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    text-align: center;
    margin: 2rem 0;
    min-height: 100px;
    display: none; /* Hide all ads by default */
    align-items: center;
    justify-content: center;
    position: relative;
}

.ad-space.banner {
    min-height: 120px;
    max-width: 728px;
    margin: 2rem auto;
    display: none; /* Explicitly hide banner ads */
}

.ad-space.square {
    min-height: 280px;
    max-width: 300px;
    margin: 2rem auto;
    display: none; /* Explicitly hide square ads */
}

.ad-space.mobile-banner {
    min-height: 100px;
    max-width: 320px;
    margin: 1.5rem auto;
    display: none; /* Hide mobile banners */
}

/* Sidebar ads for larger screens */
.ad-space.sidebar-left,
.ad-space.sidebar-right {
    position: fixed;
    width: 160px;
    min-height: 600px;
    margin: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: none; /* Hide sidebar ads */
}

.ad-space.sidebar-left {
    left: 20px;
}

.ad-space.sidebar-right {
    right: 20px;
}

.ad-placeholder {
    color: var(--sub);
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.7;
}

/* Main content adjustment for sidebar ads */
.main-with-sidebars {
    max-width: calc(var(--page-max) - 400px);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Show sidebar ads on large screens - DISABLED FOR NOW */
/* @media (min-width: 1400px) {
    .ad-space.sidebar-left,
    .ad-space.sidebar-right {
        display: flex;
    }
    
    .container {
        max-width: calc(var(--page-max) - 200px);
    }
} */

/* Ad responsiveness - DISABLED FOR NOW */
/* @media (max-width: 768px) {
    .ad-space.banner {
        display: none;
    }
    
    .ad-space.mobile-banner {
        display: flex;
    }
    
    .ad-space.square {
        max-width: 280px;
        min-height: 250px;
    }
    
    .ad-space.sidebar-left,
    .ad-space.sidebar-right {
        display: none;
    }
}

@media (max-width: 1399px) {
    .ad-space.sidebar-left,
    .ad-space.sidebar-right {
        display: none;
    }
} */

/* Responsive styles */
@media (max-width: 768px) {
    .features {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .about-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .features {
        grid-template-columns: 1fr;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation reduction for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    
    .feature-card:hover, .tool-card:hover, .category-card:hover, .about-card:hover {
        transform: none;
    }
}

/* Skip Navigation for Accessibility */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--brand);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-nav:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


