/* --- EXCLUSIVE PALETTE --- */
:root {
    --bg-primary: #3a3c45;
    --bg-card: #202624;
    --text-primary: #FFFFFF;
    --accent-green: #04BF45;
    --accent-blue: #5E75F2;
    --accent-teal: #3DD9AD;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    --header-height: 70px;
    --sidebar-width: 280px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: 3px; }

/* --- HEADER --- */
.main-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-container {
    max-width: 100%; height: 100%;
    margin: 0 auto; padding: 0 40px;
    display: flex; align-items: center; justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 32px; height: 32px; color: var(--accent-green); }
.logo-title { font-size: 1.2rem; font-weight: 700; letter-spacing: 1px; color: var(--text-primary); }

/* Desktop Nav */
.desktop-nav { display: block; }
.nav-list { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-link {
    font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
    text-decoration: none; padding: 8px 0; position: relative;
    transition: color 0.2s ease;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--text-primary); font-weight: 600; }
.nav-link.active::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 100%; height: 2px;
    background-color: var(--accent-green);
}

/* Mobile Menu Buttons */
.header-actions { display: flex; gap: 10px; }
.mobile-menu-btn { display: none; background: transparent; border: none; cursor: pointer; padding: 8px; color: var(--text-primary); }
.mobile-menu-btn svg { width: 24px; height: 24px; }

/* --- MOBILE OVERLAYS --- */
.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(4px); z-index: 2000;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }

.mobile-menu {
    position: absolute; top: 0; right: 0; width: 300px; height: 100vh;
    background: var(--bg-card); box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    transform: translateX(100%); transition: transform 0.3s ease;
    display: flex; flex-direction: column;
}
.mobile-menu-overlay.active .mobile-menu { transform: translateX(0); }

.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border-color); }
.mobile-menu-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.mobile-close-btn { background: transparent; border: none; cursor: pointer; padding: 4px; color: var(--text-secondary); transition: color 0.2s ease; }
.mobile-close-btn:hover { color: var(--text-primary); }
.mobile-close-btn svg { width: 24px; height: 24px; }

.mobile-nav { padding: 20px; overflow-y: auto; flex: 1; }
.mobile-nav-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mobile-nav-link { display: block; padding: 12px 16px; font-size: 1rem; color: var(--text-secondary); text-decoration: none; border-radius: var(--radius-sm); transition: background 0.2s ease, color 0.2s ease; }
.mobile-nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.mobile-nav-link.active { color: var(--accent-green); font-weight: 600; background: rgba(4, 191, 69, 0.1); }

.mobile-filters-content { padding: 20px; overflow-y: auto; flex: 1; }

/* --- APP CONTAINER --- */
.app-container { display: flex; min-height: 100vh; padding-top: var(--header-height); }

/* Sidebar (Desktop) */
.sidebar {
    width: var(--sidebar-width); background: rgba(0, 0, 0, 0.15);
    border-right: 1px solid var(--border-color);
    position: fixed; left: 0; top: var(--header-height); bottom: 0;
    display: flex; flex-direction: column; z-index: 100; overflow-y: auto;
}

.sidebar-header { padding: 24px 20px 0 20px; }
.filter-logo-text { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.filter-logo-accent { font-size: 0.7rem; color: var(--accent-teal); }

.filter-section { padding: 20px; flex: 1; }
.filter-title { font-size: 0.75rem; font-weight: 600; letter-spacing: 1.5px; color: var(--accent-blue); margin-bottom: 24px; text-transform: uppercase; }

.filter-group { margin-bottom: 28px; }
.filter-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 10px; }

/* Reset Button */
.reset-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 10px; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.85rem; font-weight: 500; cursor: pointer;
    transition: all 0.2s ease; margin-bottom: 24px;
}
.reset-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); border-color: var(--accent-green); }

.search-input-wrapper { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }

.filter-input {
    width: 100%; padding: 10px 12px 10px 40px; background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    color: var(--text-primary); font-family: inherit; font-size: 0.9rem;
    transition: all 0.2s ease;
}
.filter-input:focus { outline: none; border-color: var(--accent-blue); background: rgba(0, 0, 0, 0.5); }
.filter-input::placeholder { color: var(--text-muted); }

.filter-options { display: flex; flex-direction: column; gap: 6px; }

/* --- CATEGORY LIST STYLES (Clickable Items) --- */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-item {
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Selected State */
.category-item.active {
    background: rgba(4, 191, 69, 0.1);
    color: var(--accent-green);
    border-color: var(--accent-green);
    font-weight: 600;
}

/* Checkbox Styles (kept for Type/Price) */
.filter-checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px; border-radius: var(--radius-sm); transition: background 0.2s ease; user-select: none; }
.filter-checkbox:hover { background: rgba(255, 255, 255, 0.05); }
.filter-checkbox input { display: none; }

.checkmark {
    width: 18px; height: 18px; border: 2px solid var(--text-muted);
    border-radius: 4px; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; flex-shrink: 0;
}
.filter-checkbox input:checked + .checkmark { background: var(--accent-green); border-color: var(--accent-green); }
.filter-checkbox input:checked + .checkmark::after {
    content: ''; width: 5px; height: 9px;
    border: solid var(--bg-primary); border-width: 0 2px 2px 0;
    transform: rotate(45deg); margin-bottom: 2px;
}
.option-text { font-size: 0.9rem; color: var(--text-primary); }

/* Featured Filter Style */
.featured-filter { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.single-checkbox .option-text { font-weight: 600; letter-spacing: 0.5px; }

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 32px 40px; min-height: 100vh; }
.content-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--accent-green); display: inline-block; }
.results-info { font-size: 0.95rem; color: var(--text-secondary); }
.results-info span { color: var(--accent-green); font-weight: 600; }

/* Resources Grid */
.resources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

/* Resource Card */
.resource-card {
    background: var(--bg-card); border: 1px solid transparent;
    border-radius: var(--radius-lg); overflow: hidden;
    transition: all 0.3s ease; cursor: pointer;
    display: flex; flex-direction: column; position: relative;
    text-decoration: none;
}

.resource-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    border-radius: var(--radius-lg); padding: 1px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}

.resource-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.resource-card:hover::before { opacity: 1; }

/* Featured Badge with Tooltip */
.featured-badge {
    position: absolute; top: 16px; right: 16px; z-index: 10;
    background: var(--accent-green); border-radius: 50%;
    padding: 6px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(4, 191, 69, 0.3);
}

.featured-badge svg { width: 14px; height: 14px; color: #fff; }

.featured-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%; right: 0;
    margin-top: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.featured-badge:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Mobile tap behavior for tooltip */
@media (hover: none) {
    .featured-badge:active::after {
        opacity: 1;
        visibility: visible;
    }
}


.card-header { display: flex; align-items: center; gap: 16px; padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.tool-icon-placeholder { width: 40px; height: 40px; background: rgba(255,255,255,0.05); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-icon-placeholder svg { width: 22px; height: 22px; color: var(--accent-blue); }

.card-header-text { flex: 1; min-width: 0; }
.card-title { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.card-type { font-size: 0.7rem; color: var(--accent-teal); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

.card-body { padding: 20px; flex: 1; }
.card-description { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 16px; }

.card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 0.7rem; padding: 5px 10px; border-radius: 2px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; background: rgba(94, 117, 242, 0.15); color: var(--accent-blue); border: 1px solid rgba(94, 117, 242, 0.3); }
.tag:nth-child(2) { background: rgba(61, 217, 173, 0.15); color: var(--accent-teal); border-color: rgba(61, 217, 173, 0.3); }

/* Empty State */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
.empty-icon { width: 48px; height: 48px; color: var(--accent-blue); margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-primary); margin-bottom: 4px; }
.empty-state p { color: var(--text-secondary); font-size: 0.9rem; }

/* Animation */
.resource-card { opacity: 0; animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.resource-card:nth-child(1) { animation-delay: 0.05s; }
.resource-card:nth-child(2) { animation-delay: 0.1s; }
.resource-card:nth-child(3) { animation-delay: 0.15s; }
.resource-card:nth-child(4) { animation-delay: 0.2s; }
.resource-card:nth-child(5) { animation-delay: 0.25s; }
.resource-card:nth-child(6) { animation-delay: 0.3s; }
.resource-card:nth-child(7) { animation-delay: 0.35s; }
.resource-card:nth-child(8) { animation-delay: 0.4s; }

/* Hidden Utility */
.hidden { display: none !important; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .sidebar { display: none; } 
    .main-content { margin-left: 0; }
}
@media (max-width: 768px) {
    .header-container { padding: 0 20px; }
    .desktop-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .main-content { padding: 24px 20px; }
    .resources-grid { grid-template-columns: 1fr; }
}

/* --- TYPOGRAPHY SYSTEM --- */

/* Main Page Titles */
.page-header {
    margin-bottom: 40px;
    width: 100%;
}

.page-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 600px;
    line-height: 1.5;
}

/* Section Titles (h2) */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
    opacity: 0.5;
}

/* Card Titles (h3) - already defined but reinforced */
.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

/* Footer Styles */
.main-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: auto; /* Pushes footer to bottom if flex container */
    width: 100%;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-link {
    font-size: 0.9rem;
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .page-main-title { font-size: 1.8rem; }
    .page-subtitle { font-size: 1rem; }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
        padding: 0 20px;
    }
}

.submit-link {
    background: var(--accent-green);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: background 0.2s ease;
}