:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --background-color: #f8fafc;
  --text-color: #1e293b;
  --card-bg: #ffffff;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --font-family: "Poppins", sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
}

/* Header */
.navbar {
  background-color: var(--primary-color);
  padding: 1rem 2rem;
  color: white;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Main Container */
.container {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Book Card */
.book-container {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.book-container h2 {
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.book-container h5 {
  color: #64748b;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.book-container p {
  color: #334155;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.book-container button {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
  align-self: flex-start;
}

.book-container button:hover {
  background: #dc2626;
}

/* Add Button */
.add-button {
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 2rem;
  border: none;
  position: fixed;
  right: 30px;
  bottom: 30px;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgb(99 102 241 / 0.4);
  transition:
    transform 0.2s,
    background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-button:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

/* Popup */
.popup-overlay {
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: none;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.popup-box {
  background: white;
  width: 90%;
  max-width: 500px;
  padding: 2rem;
  border-radius: 12px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Center perfectly */
  z-index: 20;
  display: none;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.popup-box h2 {
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.popup-box input,
.popup-box textarea {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.popup-box input:focus,
.popup-box textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.popup-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.popup-box button {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s;
}

#add-book {
  background: var(--primary-color);
  color: white;
}

#cancel-popup {
  background: #e2e8f0;
  color: #475569;
}

#add-book:hover,
#cancel-popup:hover {
  opacity: 0.9;
}
