/* --- Variables --- */
:root {
    --primary: #2563EB; /* SoftHub Blue */
    --primary-hover: #1d4ed8;
    --bg-body: #F9FAFB;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --icon-bg: #EFF6FF;
    --radius: 12px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary: #3B82F6;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --icon-bg: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-body); color: var(--text-main); font-family: 'Inter', sans-serif; transition: background 0.3s, color 0.3s; }

/* --- Navbar --- */
.navbar { background: var(--bg-card); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; }

.brand-logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.25rem; color: var(--text-main); }
.logo-icon { background: var(--primary); color: white; border-radius: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }

.search-bar { flex: 1; max-width: 480px; position: relative; }
.search-bar input { width: 100%; padding: 12px 12px 12px 44px; border-radius: 50px; border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-main); font-size: 0.95rem; outline: none; }
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); background: var(--bg-card); }
.search-bar .material-icons-outlined { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.icon-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: 50%; transition: 0.2s; }
.icon-btn:hover { background: var(--bg-body); color: var(--text-main); }

/* --- Main Layout --- */
.main-content { max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem; min-height: 80vh; }

.page-header { margin-bottom: 3.5rem; }
.page-header h1 { font-size: 2.25rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -0.025em; }
.page-header p { color: var(--text-muted); font-size: 1.125rem; max-width: 600px; }

/* --- Categories --- */
.category-section { margin-bottom: 4rem; }
.section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.section-title { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title .material-icons-outlined { color: var(--primary); }

/* --- Card Grid --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; }

.card { 
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); 
    padding: 1.5rem; transition: all 0.2s ease; display: flex; flex-direction: column; 
    box-shadow: var(--shadow); 
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary); }

.card-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.card-icon-box { 
    width: 56px; height: 56px; border-radius: 12px; background: var(--icon-bg); 
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
}
.card-img { width: 100%; height: 100%; object-fit: cover; }

.card-info h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text-main); }
.card-info p { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }

.card-desc { font-size: 0.925rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.5; flex-grow: 1; }

.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: auto; }

/* Buttons */
.btn { 
    padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 0.875rem; 
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}

/* Free Button (Outlined) */
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { border-color: var(--text-muted); background: var(--bg-body); }

/* Paid Button (Solid) */
.btn-solid { background: var(--primary); border: 1px solid var(--primary); color: white; }
.btn-solid:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* Footer */
.site-footer { text-align: center; padding: 2rem; color: var(--text-muted); border-top: 1px solid var(--border-color); margin-top: 4rem; }

/* Mobile */
@media (max-width: 600px) {
    .nav-container { flex-wrap: wrap; gap: 1rem; }
    .search-bar { width: 100%; max-width: 100%; order: 3; }
    .card-grid { grid-template-columns: 1fr; }
}