/* RESET AND BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Poppins', sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* LAYOUT */
.layout {
  display: flex;
  height: 100vh;
}
.main {
  flex-grow: 1;
  padding: 40px;
  background-color: #f5f5f5;
}

/* HEADER */
.header {
  text-align: center;
  margin-bottom: 100px;
}

/* CATEGORY BAR */

.category-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* CATEGORY BUTTON */
.category-btn,
#addCategoryBtn {
  position: relative;
  width: 80px;
  height: 80px;
  border: 2px solid #333;
  border-radius: 16px;
  background-color: white;
  color: #333;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}
.category-btn .delete-icon {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1.2rem;
  color: rgb(139, 0, 0);
  cursor: pointer;
}
.category-btn:hover .delete-icon {
  display: block;
}
.category-btn:hover {
  background-color: #f2f2f2;
}

.category-btn.active {
  background-color: #333;
  color: white;
  transform: scale(1.05);
}
#addCategoryBtn {
  border-color: rgb(139, 0, 0);
  color: rgb(139, 0, 0);
  font-size: 2rem;
  font-weight: bold;
}
#addCategoryBtn:hover {
  background-color: rgba(139, 0, 0, 0.1);
  transform: scale(1.05);
}
/* VIEW TASKS (MODAL)*/
.tasks-view-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;    
  justify-content: center;
  align-items: center;
  z-index: 50;
}
.tasks-modal-content {
  background-color: white;
  width: 90%;
  max-width: 500px; 
  max-height: 90%;
  padding: 20px 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto; 
}
.tasks-modal-content .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
}
.tasks-modal-content .close-btn:hover {
  color: #333;
}
.tasks-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.tasks-modal-header h2 {
  font-size: 1.6rem;
  font-weight: 600;
}
.add-task-btn-modal {
  background-color: rgb(139, 0, 0);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.add-task-btn-modal:hover {
  background-color: rgb(120, 0, 0);
  transform: scale(1.03);
}
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.task-item-modal {
  background-color: #f9f9f9;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 6px solid #444; 
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-size: 1rem;
}
.task-item-modal .task-title {
  font-weight: 600;
  font-size: 1.1rem;
}
.task-item-modal .task-subject,
.task-item-modal .task-deadline {
  font-size: 0.95rem;
  color: #555;
}
.no-tasks-msg {
  padding: 20px;
  color: #888;
  font-size: 1rem;
  text-align: center;
}
/* MODALS & OVERLAYS  */
.form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10;
  display: none;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 11;
  display: none;
  width: 90%;
  max-width: 400px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  display: block;
}
.modal h3 {
  margin-bottom: 16px;
  font-size: 1.4rem;
  font-weight: 600;
}
.modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}
.modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.modal-buttons button {
  flex: 1;
  padding: 10px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.modal-buttons button:first-child {
  background-color: rgb(139, 0, 0);
  color: white;
}
.modal-buttons button:first-child:hover {
  background-color: rgb(120, 0, 0);
}
.modal-buttons button:last-child {
  background-color: #f0f0f0;
  color: #333;
}
.modal-buttons button:last-child:hover {
  background-color: #e0e0e0;
}

/* CLOSE BUTTON */
.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
}
.close-btn:hover {
  color: #333;
}