/*
 * Copyright 2026 eraflo
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:root {
    --bg-dark: #0f1115;
    --bg-card: #181b21;
    --bg-input: #22262e;
    --border: #303642;
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --accent: #ff4b4b; /* Compass needle red */
    --accent-glow: rgba(255, 75, 75, 0.15);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 32px;
    width: auto;
}

.navbar h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

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

.links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-publish {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    background-color: transparent;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-publish:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(255, 75, 75, 0.05);
}

.btn-github {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-github:hover {
    background: var(--border);
    border-color: var(--text-muted);
}

/* Hero */
.hero {
    text-align: center;
    padding: 5rem 1rem 3rem;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Install Box */
.install-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.2rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.cmd-prompt { color: var(--text-muted); user-select: none; }
.cmd { color: var(--accent); font-weight: 700; }
.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}
.copy-btn:hover { color: #fff; background: var(--border); }

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

#search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--text-muted);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.author {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.description {
    color: #b0b8c4;
    font-size: 0.95rem;
    flex-grow: 1;
}

/* Command Snippet in Card */
.snippet {
    background: #000;
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--border);
}

.snippet code {
    color: #4ade80; /* Success green for command */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1rem;
}

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

.tag {
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

/* Loading */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 3rem;
}
