body { font-family: sans-serif; background: #fdfdfd; margin: 0; padding-top: 150px; }

/* Update the header to handle wrapping */
header {
    background: #1f8dd6;
    color: white;
    padding: 1em;
    position: fixed; top: 0; width: 100%; z-index: 1000;
    box-sizing: border-box;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows search to drop below title on small screens */
    gap: 10px;
}

.filter-bar {
    background: rgba(0,0,0,0.1);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.filter-bar form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap; /* Allows filters to stack on mobile */
}

.filter-group { display: flex; align-items: center; gap: 8px; font-size: 0.9em; }

/* Pure Button Customization */
.button-secondary { background: #e6e6e6; color: #333; font-size: 0.8em; }

.book-grid {
    margin-top: 100px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.book-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5em;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.category-tag {
    --tag-color: #666;
    background: var(--tag-color);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7em;
    text-transform: uppercase;
}

.shelf-tag { float: right; color: #888; font-size: 0.8em; }

.edit-btn { margin-top: 15px; width: 100%; }

.pagination { text-align: center; margin: 2em 0; }
.page-info { margin: 0 1em; font-weight: bold; }

/* Responsive adjustments */
@media (max-width: 768px) {
    body { padding-top: 220px; } /* Give more room for the stacked header */

    .header-top h1 { width: 100%; margin: 0 0 10px 0; font-size: 1.5rem; }
    .search-bar { width: 100%; display: flex; }
    .search-bar input { flex-grow: 1; }

    .filter-group { width: 100%; justify-content: space-between; }
    .filter-group select { width: 70%; }
}

/* Container for the edit page */
.edit-body {
    background-color: #f0f2f5;
    padding: 10px;
}

.edit-container {
    max-width: 700px;
    margin: 20px auto;
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.edit-container h2 {
    margin-top: 0;
    color: #1f8dd6;
    border-bottom: 2px solid #1f8dd6;
    padding-bottom: 10px;
}

/* Adds the 'Google Form' spacing between rows */
.input-spacing {
    padding: 10px 5px;
}

/* Form labels styling */
.pure-form-stacked label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

/* Buttons at the bottom */
.button-group {
    margin-top: 20px;
    padding: 10px 5px;
    display: flex;
    gap: 10px;
}

.button-group button, .button-group a {
    flex: 1; /* Makes buttons equal width on mobile */
    text-align: center;
}