/* -----------------------------
   VARIABLES
--------------------------------*/
:root {
  --cream-bg: #f3ebe0;
  --paper-white: #fff5ee;
  --chocolate-dark: #5c3a21;
  --chocolate-med: #a67c52;
  --tan: #d2b48c;
  --tbr-gold: #f4d58d;
  --text-main: #4b2e2e;
}

/* -----------------------------
   GENERAL LAYOUT
--------------------------------*/
body {
  font-family: 'Georgia', serif;
  background: var(--cream-bg);
  color: var(--text-main);
  margin: 20px;
}

.container {
  max-width: 650px;
  margin: auto;
  background: var(--paper-white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  position: relative; /* Essential for sidebar positioning */
}

h1, h2, h3 {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  color: var(--chocolate-dark);
}

h1 { text-align: center; font-size: 2em; margin-bottom: 20px; }
h2 { margin-top: 25px; font-size: 1.5em; }
h3 { font-size: 1.2em; margin-bottom: 10px; }

/* -----------------------------
   BOOK LIST & STATUS
--------------------------------*/
ul { list-style: none; padding: 0; }

#readingList li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: background 0.2s;
}

#readingList li:hover { background: #ffe6d6; }

.status {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.status.tbr { background: var(--tan); }
.status.reading { background: var(--tbr-gold); }
.status.completed { background: var(--chocolate-med); }

.bookText { 
  flex: 1; 
  padding: 4px 8px; 
  border-radius: 6px; 
  word-break: break-word; 
}

.bookText.tbr { background: #ffe0b2; }
.bookText.reading { background: #fff0b3; }
.bookText.completed { background: var(--tan); }

.bookMeta { font-size: 13px; color: #6b4e3d; }

.bookButtons { display: flex; gap: 6px; flex-shrink: 0; }

/* -----------------------------
   FORMS & BUTTONS
--------------------------------*/
input, select, textarea {
  font-family: 'Georgia', serif;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #c49b73;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

button, #addSessionBtn {
  font-family: 'Georgia', serif;
  background: var(--chocolate-med);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover, #addSessionBtn:hover {
  background: var(--chocolate-dark);
}

/* -----------------------------
   HOVER POPUP
--------------------------------*/
#readingListHeader { 
  position: relative; 
  display: inline-block; 
}

.bookCount {
  font-size: 14px;
  padding: 3px 7px;
  border-radius: 4px;
  margin-left: 6px;
  background: var(--tan);
  color: var(--text-main);
}

.bookCountPopup {
  display: none;
  position: absolute;
  top: 35px;
  left: 0;
  background: var(--paper-white);
  border: 1px solid var(--tan);
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 8px;
  z-index: 100;
  min-width: 150px;
}

#readingListHeader:hover .bookCountPopup { display: block; }

.popupRow { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 13px; }
.popupDot { width: 10px; height: 10px; border-radius: 50%; }
.popupDot.tbr { background: var(--tan); }
.popupDot.reading { background: var(--tbr-gold); }
.popupDot.completed { background: var(--chocolate-med); }

/* -----------------------------
   SIDEBAR & GOALS
--------------------------------*/
.rightSidebar {
  position: absolute;
  right: -240px; /* Moves it to the side of the container */
  top: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rightSidebar section {
  padding: 15px;
  border-radius: 12px;
  background: var(--paper-white);
  border: 1px solid var(--tan);
}

#streakBox {
  width: 80px;
  height: 80px;
  margin: 10px auto;
  border-radius: 12px;
  background: #e6ccb3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#streakBox.active { background: var(--chocolate-med); color: white; }

.goal-item {
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--tan);
}

.progress-container {
  background: #e6ccb3;
  height: 10px;
  border-radius: 5px;
  margin: 8px 0;
  overflow: hidden;
}

.progress-bar { background: var(--chocolate-med); height: 100%; transition: width 0.5s ease; }
.goal-meta { font-size: 12px; display: flex; justify-content: space-between; }

/* -----------------------------
   ANALYTICS BOXES
--------------------------------*/
.chart-box {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--tan);
  height: 250px; /* This gives the charts room to breathe */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

#predictionCard {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid var(--chocolate-med);
  margin-top: 20px;
}

#predictionList p {
  margin: 10px 0;
  padding-bottom: 5px;
  border-bottom: 1px dashed var(--tan);
}