/* --- CSS VARIABLES --- */
:root {
    --brand-dark: #0f172a;
    --brand-card: #1e293b;
    --brand-primary: #2dd4bf;
    --brand-secondary: #fbbf24;
    --text-white: #f8fafc;
    --text-gray: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 23, 42, 0.85);
    --transition: all 0.3s ease;
}

/* --- BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--brand-dark);
    color: var(--text-white);
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.font-mono {
    font-family: "JetBrains Mono", monospace;
}

.hidden {
    display: none !important;
}

/* Utility for trimming text to 2 lines */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: var(--brand-dark);
}

.btn-primary:hover {
    background-color: white;
    transform: translateY(-2px);
}

/* --- NAVBAR --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    z-index: 100;
    background-color: var(--brand-dark);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

nav.scrolled {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -1px;
}

.nav-links, .desktop-only {
    display: none;
}

@media (min-width: 880px) {
    .nav-links {
        display: flex;
        gap: 2rem;
        font-size: 0.875rem;
    }
    .desktop-only {
        display: block !important;
    }
}

.nav-links a {
    padding: 0.5rem 0.75rem;
}

.nav-links a:hover {
    color: var(--brand-primary);
}

.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (min-width: 880px) {
    .mobile-menu-btn,
    .mobile-menu-panel {
        display: none !important;
    }
}

.mobile-menu-panel {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--brand-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    display: none;
}

.mobile-menu-panel.active {
    display: block;
}

.mobile-menu-panel a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

.mobile-menu-panel a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* --- HERO HEADER --- */
.resources-header {
    padding: 140px 0 60px;
    background: var(--brand-dark);
    position: relative;
    overflow: hidden;
}

.header-icon-bg {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 10rem;
    color: white;
    opacity: 0.05;
    pointer-events: none;
}

.badge-free {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.2);
    color: var(--brand-primary);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
    position: relative;
    z-index: 10;
}

.resources-header h1 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    z-index: 10;
}

.resources-header p {
    max-width: 650px;
    color: var(--text-gray);
    font-size: 1.125rem;
    position: relative;
    z-index: 10;
}

/* --- FILTER BAR --- */
.filter-section {
    position: sticky;
    top: 80px;
    z-index: 90;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.filter-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .filter-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}
.filter-group::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 0.4rem 1.25rem;
    border-radius: 999px;
    border: 1px solid #334155;
    background: transparent;
    color: var(--text-gray);
    font-size: 0.875rem;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--brand-primary);
}

.filter-btn.active {
    background: var(--brand-primary);
    color: var(--brand-dark);
    border-color: var(--brand-primary);
    font-weight: 700;
}

.search-wrapper {
    position: relative;
    width: 100%;
}
@media (min-width: 768px) {
    .search-wrapper {
        width: 260px;
    }
}

.search-wrapper input {
    width: 100%;
    background: var(--brand-card);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: white;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
}
.search-wrapper input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px var(--brand-primary);
}
.search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.875rem;
}

/* --- MAIN LIST CONTENT --- */
main {
    padding: 3rem 0;
    flex-grow: 1;
}

.resources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Gap tipis antar file */
}

/* List Item Styling */
.resource-item {
    background: var(--brand-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.resource-item:hover {
    border-color: rgba(45, 212, 191, 0.5);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Icon Box */
.res-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

/* Specific Colors for Categories */
.res-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}
.res-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}
.res-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}
.res-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
}

.badge-red {
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.05);
    color: #f87171;
}
.badge-blue {
    border: 1px solid rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.05);
    color: #60a5fa;
}
.badge-green {
    border: 1px solid rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.05);
    color: #4ade80;
}
.badge-purple {
    border: 1px solid rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.05);
    color: #c084fc;
}

/* Content Body */
.res-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .res-content {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
}

.res-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .res-title {
        font-size: 1rem;
        flex-grow: 1;
        width: auto;
    }
}

/* Meta / Tags */
.res-meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.res-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.res-size {
    font-size: 10px;
    color: #64748b;
    font-family: "JetBrains Mono", monospace;
}

/* Download Button */
.res-action {
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #475569;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    transition: var(--transition);
}

.btn-text {
    display: none;
}

@media (min-width: 640px) {
    .btn-download {
        width: auto;
        padding: 0.375rem 1rem;
    }
    .btn-text {
        display: inline;
        margin-left: 0.5rem;
    }
}

/* Interaksi Keren: Tombol download menyala ketika baris item di-hover */
.resource-item:hover .btn-download {
    background-color: var(--brand-primary);
    color: var(--brand-dark);
    border-color: var(--brand-primary);
}

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 2.5rem 0;
    width: 100%;
    border: 1px dashed #334155;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-icon {
    width: 48px;
    height: 48px;
    background: var(--brand-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.empty-icon i {
    font-size: 1.25rem;
    color: #64748b;
}
.empty-state h3 {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}
.empty-state p {
    font-size: 0.875rem;
    color: var(--text-gray);
}

/* --- FOOTER --- */
footer {
    background-color: #080808;
    padding: 50px 0 40px;
    position: relative;
    z-index: 2;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: block;
}

.footer-text {
    color: var(--text-gray);
    font-size: 0.875rem;
    max-width: 350px;
}

.footer-title {
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-gray);
}

.footer-links a:hover {
    color: var(--brand-primary);
}

.social-row {
    display: flex;
    gap: 1rem;
}

.social-row a {
    font-size: 1.25rem;
    color: var(--text-gray);
    transition: var(--transition);
}

.social-row a:hover {
    color: var(--icon-color);
    transform: translateY(-2px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .footer-bottom { flex-direction: row; }
}

.footer-bottom p {
    font-size: 0.75rem;
    color: #4b5563;
}
