* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: #f4f7fb;
    color: #222;
}

a {
    text-decoration: none;
    color: #2563eb;
}

header {
    background: #0f172a;
    color: white;
    padding: 15px 7%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: bold;
}

nav a {
    color: white;
    margin: 0 8px;
    font-weight: bold;
}

.hero {
    background: linear-gradient(135deg, #2563eb, #0f172a);
    color: white;
    text-align: center;
    padding: 70px 20px;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.search-box {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.search-box input {
    width: 400px;
    max-width: 80%;
    padding: 14px;
    border-radius: 8px;
    border: none;
}

.search-box button,
button,
.btn {
    background: #2563eb;
    color: white;
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-block;
    font-weight: bold;
}

.container {
    width: 86%;
    margin: 35px auto;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 25px;
}

.book-card {
    background: white;
    border-radius: 14px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.book-card img {
    width: 100%;
    height: 310px;
    object-fit: cover;
    border-radius: 10px;
    background: #ddd;
}

.book-card h3 {
    margin: 12px 0 8px;
}

.book-details {
    background: white;
    border-radius: 14px;
    padding: 25px;
    display: flex;
    gap: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.book-details img {
    width: 280px;
    height: 390px;
    object-fit: cover;
    border-radius: 10px;
}

.reader {
    width: 75%;
    margin: 35px auto;
    background: white;
    padding: 35px;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.page-content {
    font-size: 22px;
    line-height: 2.2;
    white-space: pre-line;
}

.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-box {
    width: 420px;
    max-width: 90%;
    background: white;
    margin: 80px auto;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.auth-box input,
.form-page input,
.form-page textarea,
.form-page select {
    width: 100%;
    padding: 13px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.form-page textarea {
    min-height: 140px;
}

.big-textarea {
    min-height: 350px !important;
    font-size: 18px;
    line-height: 1.8;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.success {
    background: #dcfce7;
    color: #166534;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.stats div {
    background: white;
    padding: 25px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

table th,
table td {
    padding: 13px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

table th {
    background: #0f172a;
    color: white;
}

.thumb {
    width: 55px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 12px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .search-box {
        flex-direction: column;
        align-items: center;
    }

    .search-box input {
        width: 100%;
    }

    .container {
        width: 94%;
    }

    .book-details {
        flex-direction: column;
    }

    .book-details img {
        width: 100%;
        height: auto;
    }

    .reader {
        width: 94%;
        padding: 22px;
    }

    .page-content {
        font-size: 19px;
    }

    table {
        font-size: 13px;
    }
}