/* ------------------- Base ------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #eef2ff;
  color: #111827;
  padding: 20px;
  font-size: 16px;
  line-height: 1.5;
}

/* ------------------- Header ------------------- */
header {
  width: 100%;
  background: #1e3a8a; /* Dark Blue */
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-radius: 8px;
  margin-bottom: 20px;
}
header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff; /* Library Dashboard pure white */
}

#user-info {
  text-align: right;
}
#user-name {
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff; /* Name pure white */
}
#user-email {
  font-size: 0.9rem;
  color: #ffffff; /* Email pure white */
}
#user-role {
  display: inline-block;
  background: #22c55e; /* Green badge */
  color: white;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 4px;
  font-weight: 600;
}
#user-info button {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}
#user-info button:hover { background: #b91c1c; }

/* ------------------- Search Bar ------------------- */
.search-bar {
  margin: 20px auto;
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 600px;
}
.search-bar input {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 1rem;
}
.search-bar button {
  background: #f59e0b;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
}
.search-bar button:hover { opacity: 0.9; }

/* ------------------- Books Grid ------------------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.book-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  transition: transform 0.2s, box-shadow 0.2s;
}
.book-card.available { border-left: 4px solid #22c55e; }
.book-card.unavailable { border-left: 4px solid #dc2626; }
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.book-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e40af;
}
.book-meta {
  font-size: 0.9rem;
  color: #374151;
}

/* ------------------- Book Actions ------------------- */
.book-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
button {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.9rem;
  font-weight: 600;
}
button:hover { opacity: 0.85; }
.btn-issue { background: #15803d; color: white; }
.btn-return { background: #b91c1c; color: white; }
.btn-add, .btn-save { background: #2563eb; color: white; }
.btn-delete { background: #dc2626; color: white; }
.btn-search { background: #f59e0b; color: white; }

/* ------------------- Return Section ------------------- */
#return-section {
  margin: 30px auto;
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 600px;
  background: #f9fafb;
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
#return-transaction-id {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 1rem;
}

/* ------------------- Alerts ------------------- */
.alert {
  display: none;
  padding: 8px;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* ------------------- Links ------------------- */
a { color: #2563eb; text-decoration: none; cursor: pointer; font-size: 0.9rem; }
a:hover { text-decoration: underline; }

/* ------------------- Responsive ------------------- */
@media(max-width:600px){
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); }
  .search-bar, #return-section { flex-direction: column; }
  #user-info { text-align: center; }
}


.bouncing-dots {
      display: flex;
      gap: 10px;
    }

    .bouncing-dots div {
      width: 15px;
      height: 15px;
      background: #667eea;
      border-radius: 50%;
      animation: bounce 1.4s ease-in-out infinite;
    }

    .bouncing-dots div:nth-child(2) { animation-delay: 0.2s; }
    .bouncing-dots div:nth-child(3) { animation-delay: 0.4s; }

    @keyframes bounce {
      0%, 80%, 100% { transform: translateY(0); }
      40% { transform: translateY(-30px); }
    }
