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

:root {
    --bg: #0f0e0c;
    --surface: #1a1815;
    --card: #211f1b;
    --border: #2e2b26;
    --accent: #c9a84c;
    --accent-dim: #8a6f30;
    --text: #f0ebe0;
    --text-muted: #7a7368;
    --text-soft: #b0a898;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
}

/* ── NAVBAR ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 14, 12, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.04em;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 0.45rem 1rem;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    letter-spacing: 0.02em;
}

.nav-links a:hover {
    color: var(--accent);
    background: rgba(201, 168, 76, 0.08);
}

/* ── HERO ── */
.hero {
    padding: 4rem 2.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 0.5rem;
}

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

.hero-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.75rem;
}

.divider {
    max-width: 1200px;
    margin: 0 auto 2.5rem;
    padding: 0 2.5rem;
    border: none;
    border-top: 1px solid var(--border);
}

/* ── GRID ── */
.books-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* ── CARD ── */
.book-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    animation: fadeUp 0.4s ease both;
}

.book-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-dim);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,168,76,0.1);
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

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

.book-number {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--accent-dim);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.book-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.book-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.82rem;
}

.meta-label {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 70px;
    letter-spacing: 0.03em;
}

.meta-value {
    color: var(--text-soft);
    flex: 1;
}

.meta-value.accent { color: var(--accent); font-weight: 500; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.tag {
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.2);
    color: var(--accent-dim);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.05em;
}

/* ── EMPTY STATE ── */
.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-soft);
    margin-bottom: 0.5rem;
}

.empty p { font-size: 0.9rem; }

.empty a {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.6rem 1.5rem;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: opacity 0.2s;
}

.empty a:hover { opacity: 0.85; }

/* ── ANIMATION ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.book-card:nth-child(1) { animation-delay: 0.05s; }
.book-card:nth-child(2) { animation-delay: 0.10s; }
.book-card:nth-child(3) { animation-delay: 0.15s; }
.book-card:nth-child(4) { animation-delay: 0.20s; }
.book-card:nth-child(5) { animation-delay: 0.25s; }
.book-card:nth-child(6) { animation-delay: 0.30s; }

@media (max-width: 640px) {
    nav { padding: 0 1.25rem; }
    .nav-brand { font-size: 1.1rem; }
    .nav-links a { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
    .hero, .divider, .books-grid { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ── SEARCH BAR ── */
.search-bar-wrap {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 2.5rem;
}

.search-bar-wrap input {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar-wrap input:focus {
    outline: none;
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.search-bar-wrap input::placeholder { color: var(--text-muted); }

/* ── CARD ACTIONS ── */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-edit, .btn-delete {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-edit {
    background: rgba(201, 168, 76, 0.12);
    color: var(--accent);
    border: 1px solid rgba(201, 168, 76, 0.25);
}

.btn-delete {
    background: rgba(224, 90, 90, 0.1);
    color: #e05a5a;
    border: 1px solid rgba(224, 90, 90, 0.2);
}

.btn-edit:hover, .btn-delete:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}
