:root {
    --bg: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --gradient-1: #ff00cc;
    --gradient-2: #333399;
    --font-main: 'Outfit', sans-serif;
}

[data-theme="light"] {
    --bg: #ffffff;
    --card-bg: #f4f4f5;
    --card-border: #e4e4e7;
    --text-main: #18181b;
    --text-muted: #52525b;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.3);
    /* Invert gradient for light mode subtlety */
    --gradient-1: #60a5fa;
    --gradient-2: #e0e7ff;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--gradient-2), transparent 70%);
    opacity: 0.2;
    z-index: -1;
    filter: blur(100px);
    animation: floating 20s infinite alternate;
}

@keyframes floating {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(20%, 20%);
    }
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.logo span {
    color: var(--accent);
}

.github-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-main);
    background: var(--card-bg);
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
    font-weight: 500;
}

.github-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.theme-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 99px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

/* Hero */
.hero {
    text-align: center;
    padding: 6rem 1rem 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    /* Fallback */
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* Search */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-container input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-right: 3rem;
    /* Space for icon */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg);
    box-shadow: 0 0 20px var(--accent-glow);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Main */
main {
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.category {
    margin-bottom: 5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

.badge {
    background: var(--card-bg);
    color: var(--text-muted);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid var(--card-border);
}

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

/* Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: block;
    /* For anchor tag */
    text-decoration: none;
    /* Remove link underline */
    color: inherit;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

/* Removed complex :before hover effect for simplicity */

.card-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 8px;
    /* Slight rounded corners for icons */
}

.card h3 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.url-preview {
    display: inline-block;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags span {
    font-size: 0.75rem;
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--text-muted);
    border: 1px solid var(--card-border);
}

/* Removed .card-link styles as the whole card is now a link */

/* Footer */
footer {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
}

footer a {
    color: var(--text-main);
    text-decoration: none;
}

/* Mobile */
@media (max-width: 600px) {
    .header {
        padding: 1.5rem;
    }

    .hero {
        padding-top: 4rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}