:root {
  --primary-color: #ff7f27;  /* Orange accent color */
  --dark-color: #2c3e50;
  --light-color: #f9f9f9;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--light-color);
  color: #333;
  background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Header styles - new simplified creative header */
header {
  background: var(--dark-color);
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  color: #fff;
}

.logo i {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.logo span {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1rem;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.1);
}

nav ul li a:hover {
  color: #fff;
  background: var(--primary-color);
  transform: translateY(-2px);
}

/* Remove old header styles */
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

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

/* Form styles */
.form-container {
  background: #fff;
  padding: 2rem;
  margin: 2rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  font-family: inherit;
  background: #fff;
  transition: border 0.3s;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

button, 
.btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  border-radius: var(--radius);
  font-weight: 600;
  display: inline-block;
  text-decoration: none;
  transition: all 0.3s;
  font-size: 1rem;
}

button:hover,
.btn:hover {
  background: #e86b10;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 127, 39, 0.3);
}

/* Search bar */
.search-container {
  margin: 2rem 0;
}

.search-container form {
  display: flex;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.search-container input {
  flex: 1;
  border: none;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.search-container button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Book list */
.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 1.5rem;
  margin: 2rem 0;
}

.book-item {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer; /* Add cursor pointer to indicate clickability */
}

.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.book-image {
  height: 250px;
  overflow: hidden;
  position: relative;
}

.book-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.7) 100%);
}

.book-item:hover .book-image img {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.book-info {
  padding: 1.2rem;
}

.book-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.book-info p {
  color: #666;
  margin: 0.3rem 0;
}

.book-genre {
  background: var(--primary-color);
  color: #fff;
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-top: 0.8rem;
}

.book-item .edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

.book-item .edit-btn:hover {
  background: var(--primary-color);
}

.modal {
  display: none;
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 2rem;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: var(--radius);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.given-to-someone {
  margin-top: 1rem;
}

.given-to-someone input[type="date"] {
  width: calc(50% - 0.5rem);
  margin-right: 1rem;
}

/* Section headings */
.section-title {
  font-size: 1.8rem;
  color: var(--dark-color);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  background: var(--dark-color);
  color: #fff;
  margin-top: 3rem;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
  }
  
  nav ul {
    margin-top: 1rem;
  }
  
  .book-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 3rem 0;
}

.empty-state i {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #666;
}

/* Alert styling */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.alert.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert.warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  margin-left: 10px;
}

/* Book loan styling */
.book-item.on-loan {
  border: 2px solid #3498db;
  position: relative;
}

.book-item.on-loan::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background-color: #3498db;
}

.loan-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #3498db;
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.loan-info {
  margin-top: 10px;
  padding: 10px;
  background-color: #ebf5fb;
  border-radius: var(--radius);
  border-left: 3px solid #3498db;
}

.loan-info p {
  margin: 5px 0;
  font-size: 0.9rem;
  color: #34495e;
}

.loan-info i {
  color: #3498db;
  margin-right: 5px;
}

/* Due date indicators */
.due-soon {
  color: #f39c12;
}

.overdue {
  color: #e74c3c;
  font-weight: bold;
}