/* ===========================
   Reading Streak - Styles
   =========================== */

body {
  font-family: sans-serif;
  margin: 0;
  padding: 40px 20px;
  background-color: #f5f5f5;
  color: #333;
}

header, main {
  max-width: 680px;
  margin: 0 auto;
}

header {
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #ff9a56, #ff6b6b);
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.3);
  flex-wrap: wrap;
}

.header-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

header h1 {
  font-size: 28px;
  margin-bottom: 4px;
  color: #fff;
}

header p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

/* ===========================
   Today Section
   =========================== */

#today-section {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-align: center;
}

.today-date {
  color: #888;
  font-size: 14px;
  margin: 0 0 16px;
}

.today-btn {
  background-color: #4a90e2;
  color: #fff;
  border: none;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
}

.today-btn:hover {
  background-color: #357abd;
}

.today-btn.done {
  background-color: #34c759;
}

.today-btn.done:hover {
  background-color: #2aa147;
}

/* ===========================
   Stats Section
   =========================== */

#stats-section {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #4a90e2;
  margin: 0 0 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  color: #888;
  margin: 0;
}

/* ===========================
   History Grid
   =========================== */

#history-section {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-header h2 {
  margin-bottom: 0;
}

.month-nav-btn {
  background-color: #f0f0f0;
  color: #333;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.month-nav-btn:hover:not(:disabled) {
  background-color: #4a90e2;
  color: #fff;
}

.month-nav-btn:disabled {
  color: #ccc;
  cursor: not-allowed;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.weekday-row span {
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: #aaa;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.history-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
  color: #aaa;
  border-radius: 6px;
  font-size: 12px;
}

.history-cell.empty {
  background-color: transparent;
}

.history-cell.read {
  background-color: #4a90e2;
  color: #fff;
  font-weight: bold;
}

.history-cell.is-today {
  box-shadow: 0 0 0 2px #34c759;
}

/* ===========================
   Add Book Form
   =========================== */

#book-form-section {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  margin-top: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

#book-form-section .form-group {
  margin-bottom: 16px;
}

#book-form-section label {
  display: block;
  font-weight: bold;
  margin-bottom: 2px;
}

#book-form-section small {
  display: block;
  color: #888;
  font-size: 13px;
  margin-bottom: 6px;
}

#book-form-section input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

#book-form-section input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74,144,226,0.15);
}

#book-form-section button[type="submit"] {
  background-color: #4a90e2;
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
}

#book-form-section button[type="submit"]:hover {
  background-color: #357abd;
}

/* ===========================
   Book Cards
   =========================== */

.book-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.book-title {
  font-size: 17px;
  font-weight: bold;
  margin: 0 0 12px;
}

.progress-track {
  background-color: #f0f0f0;
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  background: linear-gradient(90deg, #4a90e2, #34c759);
  height: 100%;
  border-radius: 6px;
}

.progress-text {
  font-size: 13px;
  color: #888;
  margin: 0 0 16px;
}

.book-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.page-input-label {
  font-size: 13px;
  color: #888;
}

.page-input {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.page-input:focus {
  outline: none;
  border-color: #4a90e2;
}

.finish-book-btn {
  background-color: #34c759;
  color: #fff;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto;
}

.finish-book-btn:hover {
  background-color: #2aa147;
}

.delete-book-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.delete-book-btn:hover {
  background-color: #fff0f0;
  color: #e74c3c;
}

.empty-message {
  text-align: center;
  color: #aaa;
  padding: 24px 0;
  margin: 0;
}
