body { font-family: sans-serif; background: #f4f4f9; padding: 20px; }
.container { max-width: 600px; margin: auto; }
h1 { text-align: center; color: #333; }

.input-card { 
    background: white; padding: 20px; border-radius: 10px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 20px;
}

input, select, button { 
    width: 100%; padding: 10px; margin: 5px 0; 
    border: 1px solid #ddd; border-radius: 5px; box-sizing: border-box;
}

button { background: #5a67d8; color: white; border: none; cursor: pointer; font-weight: bold; }
button:hover { background: #434190; }

.book-grid { display: grid; gap: 15px; }
.book-card { 
    background: white; padding: 15px; border-radius: 8px; 
    border-left: 5px solid #5a67d8; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.delete-btn { background: #e53e3e; margin-top: 10px; font-size: 0.8rem; }

/* Styling the search bar area */
.search-group {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-group input {
    flex: 1;
    margin: 0;
}

.search-btn {
    width: auto;
    background: #4a5568;
    padding: 0 15px;
}

/* Make book cards look like 'tiles' on mobile */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.book-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.book-card {
    display: flex;
    flex-direction: row; /* Aligns image and text side-by-side */
    gap: 15px;
    align-items: flex-start;
}

.book-cover {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.no-cover {
    width: 80px;
    height: 120px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #718096;
    border-radius: 4px;
}

.book-info {
    flex: 1; /* Takes up the rest of the space */
}

/* On mobile, stack them vertically if the screen is too small */
@media (max-width: 400px) {
    .book-card { flex-direction: column; align-items: center; text-align: center; }
}

.search-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.search-group input {
    flex: 2; /* Makes the input wider */
    margin: 0;
}

.search-btn {
    flex: 1; /* Makes the button smaller */
    background: #4a5568; /* A different color so it doesn't look like the 'Add' button */
    white-space: nowrap;
    margin: 0;
}

.search-btn:hover {
    background: #2d3748;
}