/* Updated style.css (replace your current style.css) */
/* Fonts + base */
:root {
    --bg: #0f1724;
    --card: #0b1220;
    --text: #e6eef8;
    --muted: #9fb0c8;
    --accent: #6ee7b7;
    --accent-2: #60a5fa;
    --glass: rgba(255, 255, 255, 0.03);
    --radius: 12px;
    --transition: 200ms cubic-bezier(.2, .9, .3, 1);
}

[data-theme="light"] {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #071126;
    --muted: #586b82;
    --accent: #0ea5a4;
    --accent-2: #2563eb;
    --glass: rgba(0, 0, 0, 0.03);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg), #05111a);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Top bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--card);
    box-shadow: 0 8px 28px rgba(2, 6, 11, 0.5);
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: Poppins, Inter, sans-serif;
    font-weight: 700;
    font-size: 18px;
}

.brand-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
}

/* Buttons */
.btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.btn:focus {
    outline: 3px solid rgba(99, 102, 241, 0.12);
    outline-offset: 2px;
}

.icon-btn {
    padding: 8px;
    border-radius: 10px;
    min-width: 44px;
    justify-content: center;
}

.small {
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 8px;
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(2, 6, 11, 0.35);
}

.btn.primary {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #001;
    border: none;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.08);
}

.btn.primary:hover {
    transform: translateY(-6px) scale(1.02);
}

.btn.ghost {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.04);
}

.btn.big {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 16px;
}

/* Layout */
.container {
    max-width: 1240px;
    /* widened so 5 cols look spacious */
    margin: 28px auto;
    padding: 0 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.card {
    background: var(--card);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.muted {
    color: var(--muted);
}

.hero {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    padding: 22px;
}

.hero-left {
    flex: 1;
}

.hero h1 {
    font-family: Poppins, Inter, sans-serif;
    font-size: 28px;
    margin: 0 0 8px;
}

.hero-right {
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.stats {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: space-between;
}

.stats div {
    background: rgba(255, 255, 255, 0.02);
    padding: 8px;
    border-radius: 10px;
    text-align: center;
}

.small {
    font-size: 12px;
}

/* About */
.about h2 {
    margin: 0 0 8px;
}

.about ol {
    padding-left: 18px;
}

/* Search & grid */
.searchbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.searchbar input,
.searchbar select {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: var(--text);
    font-size: 14px;
}

/* GRID: 5 columns on wide screens */
.grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    /* 5 in a row */
    gap: 18px;
    margin-top: 10px;
}

/* book card layout: keep consistent height flow */
.book {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent);
    min-height: 520px;
}

/* COVER: consistent frame using aspect-ratio and overflow hidden */
.book .cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    /* portrait */
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    display: block;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.book .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* text & meta */
.book h4 {
    margin: 8px 0 6px;
    font-size: 16px;
    line-height: 1.2;
}

.book .meta {
    font-size: 13px;
    color: var(--muted);
}

.book .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.book .muted {
    font-size: 13px;
    color: var(--muted);
}

/* admin list tweaks: show tiny cover thumbnail so editor can see which book it is */
.book.card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
}

.admin-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-thumb {
    width: 48px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
}

.admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* modal */
.hidden {
    display: none !important;
    pointer-events: none !important;
    opacity: 0;
    visibility: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 11, 0.6);
    z-index: 40;
    pointer-events: auto;
}

.modal-card {
    width: min(880px, 94%);
    background: var(--card);
    padding: 18px;
    border-radius: 12px;
    position: relative;
    max-height: 90vh;
    overflow: auto;
}

.close {
    position: absolute;
    right: 12px;
    top: 12px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
}

/* admin form */
.center {
    max-width: 520px;
    margin: 26px auto;
    padding: 24px;
}

.input-row {
    display: flex;
    gap: 8px;
}

.input-row input {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: var(--text);
}

.password-row {
    align-items: center;
}

.form-row {
    display: flex;
    gap: 8px;
}

.form-row input {
    flex: 1;
}

textarea {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: var(--text);
    min-height: 90px;
    resize: vertical;
}

/* responsive breakpoints */
@media (max-width:1200px) {
    .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width:980px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .container {
        max-width: 960px;
    }
}

@media (max-width:760px) {
    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-right {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }

    .form-row {
        flex-direction: column;
    }

    .book {
        min-height: auto;
    }

    .book .cover {
        aspect-ratio: 3 / 4;
        height: auto;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width:420px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.about h2,
h3 {
    text-decoration: underline;
    text-underline-offset: 6px;
}

/* === Search Bar Border Enhancement === */
.searchbar input,
.searchbar select {
    border: 1.6px solid rgba(3, 43, 92, 0.25);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.searchbar input::placeholder {
    color: var(--muted);
}

.searchbar input:focus,
.searchbar select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 160, 113, 0.25);
}

.footer {
    text-align: center;


}