:root {
    --cream: #F5F5DC;
    --dark-brown: #4B3621;
    --light-brown: #8B4513;
    --burgundy: #800020;
    --text-color: #333;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cream);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--dark-brown);
    color: var(--cream);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
}

.sidebar h2 {
    margin-top: 0;
    border-bottom: 2px solid var(--burgundy);
    padding-bottom: 10px;
    color: var(--cream);
}

.user-info {
    margin-bottom: 20px;
    font-size: 0.9em;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 10px;
}

.nav-links a {
    color: var(--cream);
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background-color: var(--burgundy);
}

.logout-btn {
    margin-top: auto;
    background-color: var(--burgundy);
    color: var(--white);
    text-align: center;
    padding: 10px;
    text-decoration: none;
    border-radius: 5px;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 40px;
    flex-grow: 1;
    width: calc(100% - 250px);
}

h1 {
    color: var(--dark-brown);
    border-bottom: 3px solid var(--burgundy);
    padding-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--dark-brown);
    border-radius: 4px;
    background-color: var(--white);
}

button {
    background-color: var(--burgundy);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

button:hover {
    background-color: #600018;
}

/* Grid/List for Books */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.book-card {
    background-color: var(--white);
    border: 1px solid var(--dark-brown);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.book-card:hover {
    transform: translateY(-5px);
}

.book-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--burgundy);
    margin-bottom: 5px;
}

.book-author {
    font-style: italic;
    margin-bottom: 10px;
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-available {
    background-color: #d4edda;
    color: #155724;
}

.status-unavailable {
    background-color: #f8d7da;
    color: #721c24;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--white);
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: var(--dark-brown);
    color: var(--cream);
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Login Page Specific */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    background-color: var(--cream); /* Full page background */
}

.login-box {
    background-color: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-top: 5px solid var(--burgundy);
    width: 400px;
}

.login-box h2 {
    color: var(--dark-brown);
    text-align: center;
    margin-bottom: 20px;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
