/* --- Modern Admin Variables --- */
:root {
    --primary: #5c67f2;
    --primary-hover: #4a54e1;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

h1 { font-size: 1.8rem; margin-bottom: 25px; color: var(--primary); }

/* --- Card Styling --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.card h2 {
    margin-top: 0;
    font-size: 1.25rem;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

/* --- Form Layout --- */
.ebook-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-group input {
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* --- Table Styling --- */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px;
    border-bottom: 2px solid #f1f5f9;
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-add {
    background: var(--primary);
    color: white;
    grid-column: 1 / -1; /* Spans across the form grid */
    margin-top: 10px;
}

.btn-add:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-view { background: #e0e7ff; color: #4338ca; margin-right: 8px; }
.btn-view:hover { background: #c7d2fe; }

.btn-delete { background: #fee2e2; color: #b91c1c; }
.btn-delete:hover { background: #fecaca; }

/* --- Images --- */
.cover-thumb {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

















/* Container padding and background */
.book-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* The Grid Layout */
.library-grid {
    display: grid;
    /* This creates a responsive grid: minimum 200px, maximum 1fr */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
}

/* Individual Book Card */
.book-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Book Cover Styling */
.book-cover {
    width: 100%;
    height: 320px;
    object-fit: cover; /* Ensures images aren't stretched */
    border-bottom: 1px solid #eee;
}

/* Text Content Area */
.book-info {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-title {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    color: #333;
    font-weight: 600;
}

.book-author {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 15px;
}

/* Action Button */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn:hover {
    background-color: #0056b3;
}