:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --border-color: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 70px;
}

/* Layout */
.app-container { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 280px; background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column; padding: 24px;
  position: fixed; height: 100vh; z-index: 10;
  box-shadow: var(--shadow-sm);
}

.logo-area { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.logo-icon { font-size: 28px; }
.logo-area h2 {
  font-size: 22px; font-weight: 700; color: var(--accent-color);
}

.nav-menu { display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  text-decoration: none; color: var(--text-secondary); border-radius: 12px;
  transition: all 0.3s ease; font-weight: 500;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background-color: var(--bg-primary); color: var(--text-primary); }
.nav-item.active {
  background-color: var(--accent-color); color: #fff; box-shadow: 0 4px 15px var(--accent-glow);
}

/* Bottom Nav */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; width: 100%;
  background-color: rgba(255, 255, 255, 0.9); border-top: 1px solid var(--border-color);
  z-index: 20; padding: 10px 20px; justify-content: space-around;
  backdrop-filter: blur(10px); box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--text-secondary); font-size: 12px; gap: 4px;
}
.bottom-nav-item.active { color: var(--accent-color); }

/* Main Content */
.main-content {
  flex-grow: 1; display: flex; flex-direction: column; padding: 32px 48px;
  max-width: 1400px; margin-left: 280px; width: calc(100% - 280px);
}

.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; gap: 20px; }
.search-bar {
  display: flex; align-items: center; background-color: var(--bg-secondary);
  border: 1px solid var(--border-color); border-radius: 100px; padding: 12px 24px;
  width: 100%; max-width: 500px; box-shadow: var(--shadow-sm); transition: all 0.3s ease;
}
.search-bar:focus-within { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-bar svg { color: var(--text-secondary); margin-right: 12px; width: 20px; }
.search-bar input { border: none; outline: none; background: none; font-family: inherit; font-size: 16px; width: 100%; color: var(--text-primary); }

.user-profile { display: flex; align-items: center; gap: 16px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; background: var(--accent-color); font-weight: bold;}
.greeting { font-weight: 500; }

.section-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.section-header p { color: var(--text-secondary); font-size: 16px; margin-bottom: 32px; }

/* Books Grid */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.book-card {
  background-color: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 20px; padding: 20px; transition: all 0.3s ease;
  display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.book-cover {
  width: 100%; height: 320px; border-radius: 12px; margin-bottom: 16px;
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-md);
}

.book-category { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--accent-color); margin-bottom: 8px; }
.book-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.book-author { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

.btn-read {
  display: block; padding: 12px; border-radius: 10px; border: none;
  background-color: var(--accent-color); color: white; font-family: inherit;
  font-weight: 600; font-size: 16px; cursor: pointer; text-align: center; text-decoration: none;
  box-shadow: 0 4px 10px var(--accent-glow); transition: background-color 0.2s;
}
.btn-read:hover { background-color: #2563eb; }

/* Admin Modal & Table */
.admin-container { max-width: 1000px; margin: 40px auto; padding: 30px; background-color: var(--bg-secondary); border-radius: 20px; border: 1px solid var(--border-color); box-shadow: var(--shadow-md); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th, .admin-table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
.admin-table th { color: var(--text-secondary); font-weight: 500; }
.btn-danger { background-color: var(--danger); color: white; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-family: inherit; font-weight: 600; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 100; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { background: var(--bg-secondary); border-radius: 24px; width: 100%; max-width: 450px; padding: 32px; box-shadow: var(--shadow-lg); transform: translateY(20px); transition: transform 0.3s; }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.close-modal { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text-secondary); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-primary); font-family: inherit; font-size: 15px; color: var(--text-primary); }
.form-group input:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 32px; }
.btn-secondary { padding: 12px 24px; border-radius: 10px; border: 1px solid var(--border-color); background: transparent; font-family: inherit; font-weight: 600; cursor: pointer; }
.btn-primary { padding: 12px 24px; border-radius: 10px; border: none; background: var(--accent-color); color: white; font-weight: 600; cursor: pointer; box-shadow: 0 4px 10px var(--accent-glow); }

.login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-primary); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.login-box { background: var(--bg-secondary); padding: 40px; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; text-align: center; }
.login-box input { width: 100%; padding: 12px; margin-bottom: 20px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-primary); font-family: inherit; color: var(--text-primary); }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .main-content { margin-left: 0; width: 100%; padding: 20px; }
  .top-header { flex-direction: column-reverse; align-items: flex-start; }
  .search-bar { max-width: 100%; }
  .greeting { display: none; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .book-cover { height: 220px; }
  .book-title { font-size: 15px; }
  .btn-read { padding: 10px; font-size: 14px; }
}
