/* Root  variables for light and dark modes */
:root {
  --bg-header:  #ffc2d1;
  --bg-main-light: #fff1e6;
  --bg-sidebar-light: #fde2e4;
  --text-main-light: #5a2a6b;

  /* Calendar  highlight */
  --calendar-highlight: #fad2e1;

  
  --card-light: #fde2e4;
  --completed-bg: #fad2e1;
}

/* Dark theme  */
html[data-theme="dark"] {
  --bg-header: #95727d;
  --bg-main-light: #d6cfcb;
  --bg-sidebar-light: #ccb7ae;
  --text-main-light: #231f20;
  --calendar-highlight: #a6808c;
  --card-light: #ccb7ae;
  --completed-bg: #a6808c;
}

body {
  margin: 0;
  font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
  background: var(--bg-main-light);
  color: var(--text-main-light);
}

/*  heading  */
.header-banner {
  width: 100%;
  background: var(--bg-header);
  text-align: center;
  padding: 25px 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0px 2px 8px rgba(0,0,0,0.15);
}
.header-banner h1 {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-main-light);
}

/* layout */
.dashboard-container {
  display: flex;
  gap: 15px;
  padding: 10px;
  flex-wrap: wrap; /* Enables responsiveness */
}

/* Sidebar */
.sidebar-box {
  background: var(--bg-sidebar-light);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0px 2px 8px rgba(0,0,0,0.15);
  width: 230px;
  flex-shrink: 0;
}
.sidebar-box button,
.sidebar-box select {
  width: 100%;
  margin: 8px 0;
  padding: 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--calendar-highlight);
  color: var(--text-main-light);
}
.active-days-sidebar {
  font-weight: bold;
  margin-top: 10px;
}

/* Main  */
.main-box {
  flex: 1;
  background: var(--card-light);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0px 2px 10px rgba(0,0,0,0.15);
  min-width: 300px;
}

/* Task section */
.task-input-section {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.task-input-section input,
.task-input-section select {
  padding: 8px;
  border-radius: 5px;
  border: 1px solid var(--text-main-light);
  flex: 1 1 150px;
}
.task-input-section button {
  background: var(--calendar-highlight);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  padding: 8px 12px;
}

/* Task list */
#task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.task-item {
  background: var(--card-light);
  padding: 8px;
  margin: 6px 0;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.task-item.completed {
  background: var(--completed-bg);
}

/* Calendar grid */
#calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-day {
  padding: 10px;
  border: 1px solid var(--text-main-light);
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  color: black;
}
.calendar-day.active {
  background: var(--calendar-highlight);
  font-weight: bold;
}

/* Hidden class */
.hidden {
  display: none;
}

/* Footer */
footer {
  text-align: center;
  padding: 10px;
  font-style: italic;
}

/* Respnsive*/

/*  tablets */
@media (max-width: 992px) {
  .dashboard-container {
    flex-direction: column; /* Sidebar stacks above main */
  }
  .sidebar-box {
    width: 100%; /* Full width */
  }
  .main-box {
    width: 100%;
    margin-top: 10px;
  }
}

/*  phones */
@media (max-width: 600px) {
  .header-banner h1 {
    font-size: 1.8rem; 
  }
  #calendar {
    grid-template-columns: repeat(4, 1fr); 
  }
  .task-input-section input,
  .task-input-section select,
  .task-input-section button {
    flex: 1 1 100%; 
  }
}

/* Very small phones */
@media (max-width: 400px) {
  #calendar {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .task-input-section {
    gap: 6px;
  }
  .task-item {
    font-size: 0.9rem;
  }
}
