/* ==========================================================================
   Components (Cards, Buttons, Nav, etc)
   ========================================================================== */

/* --- AdSense Placeholders --- */
.ad-slot {
    background-color: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-8);
    position: relative;
    overflow: hidden;
}
.ad-slot::before { content: 'Advertisement'; }

.ad-leaderboard {
    width: 100%;
    height: 90px;
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
}

.ad-sidebar {
    width: 100%;
    height: 250px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}


/* --- Header & Navigation --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: var(--z-header);
    display: flex;
    align-items: center;
    transition: background var(--transition-base), box-shadow var(--transition-base);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .site-header.scrolled { background: rgba(15, 23, 42, 0.85); }

.logo {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.nav-links {
    display: none;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .nav-links { display: flex; }
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-primary);
}

/* Header Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-primary);
    min-width: 160px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    top: 100%;
    padding: var(--space-2) 0;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: background-color var(--transition-fast);
}

.dropdown-content a:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-inverse);
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.39);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.23);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* ==========================================================================
   Sidebar Widgets & Bento Cards (Global)
   ========================================================================== */
.widget { background: white; border-radius: var(--radius-lg); padding: var(--space-6); margin-bottom: var(--space-6); box-shadow: var(--shadow-sm); }
.widget-title { font-size: var(--text-base); font-weight: 800; display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.widget-search { position: relative; }
.widget-search input { width: 100%; padding: var(--space-3) var(--space-10) var(--space-3) var(--space-4); border: none; border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-sm); outline: none; font-weight: 600; }
.widget-search svg { position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%); color: var(--text-secondary); }

/* Sub Nav Pills */
.sub-nav { display: flex; justify-content: center; gap: var(--space-4); margin-bottom: var(--space-8); }
.pill { padding: var(--space-2) var(--space-4); border-radius: var(--radius-full); font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); transition: all var(--transition-fast); }
.pill.active { background: #8b5cf6; color: white; }

/* Category Tabs */
.cat-tabs { display: flex; gap: var(--space-6); margin-bottom: var(--space-6); border-bottom: 1px solid var(--border-color); padding-bottom: var(--space-2); }
.cat-tab { font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; font-size: var(--text-sm); padding-bottom: var(--space-2); cursor: pointer; position: relative; }
.cat-tab.active { color: var(--text-primary); }
.cat-tab.active::after { content: ''; position: absolute; bottom: -var(--space-2); left: 0; width: 100%; height: 3px; background: var(--text-primary); }

/* Bento Grid overrides */
.bento-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bento-grid { grid-template-columns: repeat(3, 1fr); } }

/* Bento Card base style */
.bento-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 1; /* Make them square by default */
    display: flex;
    align-items: flex-end;
    padding: var(--space-4);
    color: white;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.bento-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.bento-card.wide { grid-column: span 2; aspect-ratio: 2/1; }
.bento-card-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.bento-card-gradient { position: absolute; bottom: 0; left: 0; width: 100%; height: 70%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); z-index: 2; }
.bento-card-content { position: relative; z-index: 3; width: 100%; }
.bento-card-content h3 { color: white !important; }
.bento-card-avatar { position: absolute; top: var(--space-4); left: var(--space-4); width: 32px; height: 32px; border-radius: 50%; z-index: 3; border: 2px solid white; }
