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

:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --success: #4cc9f0;
  --danger: #f72585;
  --warning: #f8961e;
  --info: #560bad;
}

body {
  background-color: #f0f2f5;
  color: var(--dark);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

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

/* header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo i {
  font-size: 2rem;
  color: var(--primary);
}

.logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
}

.stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stats-card {
  background-color: var(--light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.stats-card i {
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 8px;
}

.stats-card div {
  display: flex;
  flex-direction: column;
  margin-left: 0.5rem;
}

.total-books i {
  background-color: rgba(67, 97, 238, 0.1);
  color: var(--primary);
}

.books-read i {
  background-color: rgba(67, 97, 238, 0.1);
  color: var(--primary);
}

/* main content */
.main-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

/* sidebar */
.sidebar {
  background-color: var(--light);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  height: fit-content;
}

.sidebar h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.add-book-form .form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dark);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.checkbox-container input {
  width: auto;
}

.submit-btn {
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: var(--light);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover {
  background-color: var(--secondary);
}

/* library */
.library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background-color: var(--light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.book-cover {
  height: 180px;
  background: linear-gradient(135deg, var(--accent), var(--info));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cover-inner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light);
  font-size: 2rem;
  font-weight: bold;
}

.book-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.book-title {
  color: var(--dark);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.book-author {
  color: var(--gray);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--gray);
  margin-bottom: 1rem;
  margin-top: auto;
}

.book-meta i {
  margin-right: 5px;
  color: var(--accent);
}

.read-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.read-badge.read {
  background-color: rgba(76, 201, 240, 0.1);
  color: var(--success);
  border: 1px solid rgba(76, 201, 240, 0.3);
}

.read-badge.not-read {
  background-color: rgba(248, 150, 30, 0.1);
  color: var(--warning);
  border: 1px solid rgba(248, 150, 30, 0.3);
}

.book-actions {
  display: flex;
  gap:  0.75rem;
  margin-top: 1.5rem;
}

.action-btn{
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.action-btn i {
  font-size: 0.9rem;
}

.toggle-read-btn {
  background-color: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  border: 1px solid rgba(67, 97, 238, 0.2);
}

.toggle-read-btn:hover {
  background-color: rgba(67, 97, 238, 0.2);
}

.delete-btn {
  background-color: rgba(247, 37, 133, 0.1);
  color: var(--danger);
  border: 1px solid rgba(247, 37, 133, 0.2);
}

.delete-btn:hover {
  background-color: rgba(247, 37, 133, 0.2);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  background-color: var(--light);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.empty-state i {
  font-size: 3rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.empty-state p {
  color: #6c757d;
  max-width: 400px;
  margin: 0 auto;
}