* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 0;
    margin: 0;
}

nav {
    background-color: #2c3e50;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background-color: #34495e;
    color: #fff;
}

nav > a:first-child {
    font-size: 1.25rem;
    font-weight: 600;
}

nav > div {
    display: flex;
    gap: 0.5rem;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2rem;
}

h1 small {
    font-size: 1rem;
    font-weight: normal;
    color: #7f8c8d;
    margin-left: 0.5rem;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 600;
}

h5 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 0.5rem 0;
    font-weight: 600;
}

form {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

form div {
    margin-bottom: 1.5rem;
}

.search-form div {
    margin-bottom: 1rem;
}

.search-form input[type="submit"] {
    margin-top: 1rem;
}

form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input[type="submit"], button {
    background-color: #3498db;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: inherit;
}

input[type="submit"]:hover, button:hover {
    background-color: #2980b9;
}

input[type="submit"]:active, button:active {
    transform: translateY(1px);
}

.inline-form {
    display: inline-block;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
    margin: 0;
}

.inline-form input[type="submit"] {
    background-color: #27ae60;
}

.inline-form input[type="submit"]:hover {
    background-color: #229954;
}

.inline-form input[value*="Remove"] {
    background-color: #e74c3c;
}

.inline-form input[value*="Remove"]:hover {
    background-color: #c0392b;
}

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 1rem;
}

.error-message span {
    display: block;
}

.flash-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #28a745;
    margin-bottom: 1rem;
}

div[role="alert"] {
    background-color: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 1rem;
}

div[role="alert"] span {
    display: block;
}

.book-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.book-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.book-card img {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.book-card h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.25rem;
}

.book-card h5 span {
    font-weight: normal;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.book-detail {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.book-header {
    margin-bottom: 1rem;
}

.book-header h1 {
    display: inline;
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0;
}

.book-date {
    display: inline;
    font-weight: normal;
    color: #7f8c8d;
    font-size: 1rem;
    margin-left: 0.5rem;
}

.book-cover {
    max-width: 300px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin: 1rem 0;
}

.book-info {
    list-style: none;
    margin-top: 1.5rem;
}

.book-info li {
    margin: 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.book-info li:last-child {
    border-bottom: none;
}

.book-info b {
    color: #2c3e50;
    font-weight: 600;
}

.book-description {
    margin-top: 0.5rem;
    color: #555;
    line-height: 1.8;
}

.book-actions {
    margin-top: 1.5rem;
}

.reviews-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.reviews-section h1 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.reviews-list {
    list-style: none;
    margin-bottom: 2rem;
}

.review-item {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.review-item:last-child {
    border-bottom: none;
}

.review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.review-content {
    flex: 1;
}

.review-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.review-author {
    color: #3498db;
    text-decoration: none;
    margin-left: 0.5rem;
    font-weight: 500;
}

.review-author:hover {
    text-decoration: underline;
}

.review-text {
    margin-top: 0.5rem;
    color: #333;
    line-height: 1.6;
}

.review-form-container {
    margin-top: 2rem;
}

.review-form {
    margin-bottom: 0;
}

.saved-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.saved-book-card {
    display: block;
    text-align: center;
    text-decoration: none;
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.saved-book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.saved-book-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.saved-book-card h5 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #2c3e50;
}

.empty-state {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
    padding: 3rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    grid-column: 1 / -1;
    white-space: normal;
    word-wrap: normal;
    line-height: 1.6;
}

.auth-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-link {
    text-align: center;
    margin-bottom: 1rem;
    color: #555;
}

.form-link a {
    color: #3498db;
    text-decoration: none;
}

.form-link a:hover {
    text-decoration: underline;
}

.account-header {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3498db;
    flex-shrink: 0;
}

.account-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.account-section h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.account-form {
    margin-bottom: 0;
}

.account-link {
    text-align: center;
    margin-top: 2rem;
}

.account-link a {
    color: #3498db;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
}

.account-link a:hover {
    text-decoration: underline;
}

input[type="file"] {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
}

input[type="file"]:focus {
    outline: none;
    border-color: #3498db;
}

.error-page {
    text-align: center;
    padding: 4rem 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.error-page h1 {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-page p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.home-link {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.home-link:hover {
    background-color: #2980b9;
    text-decoration: none;
}

.user-header {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-header .profile-image {
    width: 80px;
    height: 80px;
}

.user-header h2 {
    margin: 0;
}

.user-reviews {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-reviews-list {
    list-style: none;
}

.user-review-item {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.user-review-item:last-child {
    border-bottom: none;
}

.user-review-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-review-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.user-review-text {
    color: #333;
    line-height: 1.6;
    margin: 0;
}

.user-review-text strong {
    color: #2c3e50;
    font-weight: 600;
}

a:not(nav a):not(.book-card):not(.saved-book-card):not(.review-author):not(.home-link):not(.account-link a) {
    color: #3498db;
    text-decoration: none;
}

a:not(nav a):not(.book-card):not(.saved-book-card):not(.review-author):not(.home-link):not(.account-link a):hover {
    text-decoration: underline;
}