* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}


body {
  background: linear-gradient(180deg, #e3f2fd, #bbdefb);
  color: #222;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}



header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #5d3fd3;
  color: #fff;
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
}


header h1 {
  font-size: 1.8rem;
  font-weight: 600;
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}


.add-task-btn {
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}


.add-task-btn:hover {
  background: #34c759;
  transform: translateY(-2px);
}


.user-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}


.profile-icon {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #5d3fd3;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}


.profile-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}


.profile-dropdown {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  overflow: hidden;
  min-width: 220px;
  z-index: 1000;
  animation: slideDown 0.2s ease-out;
}


.profile-dropdown.active {
  display: block;
}


@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.9rem 1.2rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}


.dropdown-item:last-child {
  border-bottom: none;
}


.dropdown-item:hover {
  background: #f8f7ff;
  color: #5d3fd3;
}


.dropdown-icon {
  font-size: 1.2rem;
}



main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}



#analytics {
  background: #fff;
  border-radius: 12px;
  margin: 1.5rem auto 0;
  width: 95%;
  padding: 1rem 2rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  flex-shrink: 0;
}


.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}


.analytics-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
}


.analytics-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
}


.analytics-card {
  background: #f9f8ff;
  border-radius: 12px;
  text-align: center;
  flex: 1 1 auto;
  padding: 1rem;
  min-width: 120px;
  transition: 0.3s;
}


.analytics-card:hover {
  background: #ebe5ff;
}


.analytics-card span {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: #5d3fd3;
}


.analytics-card p {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.3rem;
}



#filters {
  background: #fff;
  border-radius: 12px;
  margin: 1rem auto;
  width: 95%;
  padding: 1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  flex-shrink: 0;
}


.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
}


#filters input,
#filters select {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
}


#clearFilters {
  background: transparent;
  color: #5d3fd3;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 600;
  flex-shrink: 0;
}


#clearFilters:hover {
  color: #836fff;
  background: transparent;
}



.board {
  width: 95%;
  margin: 0 auto 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


.columns {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  flex: 1;
  overflow: hidden;
}


.column {
  background: #fff;
  border-radius: 12px;
  flex: 1 1 30%;
  min-width: 300px;
  padding: 1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


.column h3 {
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
  flex-shrink: 0;
}


.task-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 0.3rem;
}


.task-list::-webkit-scrollbar {
  width: 6px;
}


.task-list::-webkit-scrollbar-thumb {
  background: #d2c7ff;
  border-radius: 6px;
}


.task {
  background: #f5f5f5;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: 0.3s;
  cursor: move;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;        
  gap: 12px;
}


.task:hover {
  background: #ebe5ff;
}


.task.dragging {
  opacity: 0.5;
}


.task-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0; 
  flex: 1;
}


.task-title {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
  word-break: break-word;
}


.task-desc {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 6px;
  word-break: break-word;
}


.task-meta {
  display: flex;
  align-items: center;      
  gap: 12px;                
  margin-top: 0;
  flex-wrap: wrap;
}


.category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #222;
  line-height: 1;
  white-space: nowrap;
}


.category.Home { background: #2ecc71; }
.category.Office { background: #8e44ad; }    
.category.Personal { background: #1abc9c; }
.category.Others { background: #f39c12; }


.task-date {
  font-size: 0.9rem;
  color: #666;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}


.task-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 12px;
  flex-shrink: 0;
  position: relative;
}


.task-menu-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 6px;
  color: #666;
  line-height: 1;
  transition: all 0.2s ease;
}


.task-menu-btn:hover {
  background: rgba(0,0,0,0.08);
  color: #333;
}


.task-action-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
  margin-top: 4px;
}


.task-action-menu.active {
  display: block;
  animation: slideDown 0.2s ease-out;
}


.task-action-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}


.task-action-menu-item:last-child {
  border-bottom: none;
}


.task-action-menu-item:hover {
  background: #f8f7ff;
  color: #5d3fd3;
}


.task-action-menu-item.delete:hover {
  background: #ffe5e5;
  color: #dc3545;
}


.task-status-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  background: white;
  color: #333;
  font-weight: 500;
  margin: 0.3rem 0;
}


.task-status-select:focus {
  outline: none;
  border-color: #5d3fd3;
}


.task-menu-divider {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #f0f0f0;
}


.task-menu-divider label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}



.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
}


.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  position: relative;
  overflow: visible;
  margin: 2rem auto;
  max-height: 90vh;
}


.close-modal,
.close-update-modal,
.close-password-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  transition: color 0.3s;
  z-index: 1;
}


.close-modal:hover,
.close-update-modal:hover,
.close-password-modal:hover {
  color: #333;
}


.modal-content h2 {
  margin-bottom: 1rem;
  color: #5d3fd3;
}


.modal-content input,
.modal-content select {
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
}


.modal-content select {
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
}


.modal-content label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  color: #333;
}


.modal-content button {
  background: #5d3fd3;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  margin-right: 0.5rem;
  transition: 0.3s;
}


.modal-content button:hover {
  background: #836fff;
}


.modal-content .btn-cancel {
  background: #6c757d;
}


.modal-content .btn-cancel:hover {
  background: #5a6268;
}


.profile-info {
  background: #f9f8ff;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}


.profile-info p {
  margin: 0.5rem 0;
  color: #333;
}


.profile-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}


.btn-update {
  background: #28a745 !important;
}


.btn-update:hover {
  background: #34c759 !important;
}


.btn-change {
  background: #007bff !important;
}


.btn-change:hover {
  background: #0056b3 !important;
}



@media (max-width: 900px) {
  body {
    transform: none;
    width: 100%;
  }
  
  #analytics {
    padding: 0.8rem 1rem;
    margin: 1rem auto 0;
    width: 98%;
  }
  
  .analytics-header h2 {
    font-size: 1.1rem;
  }
  
  #analyticsData {
    display: flex !important;
  }
  
  .analytics-container {
    gap: 0.5rem;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    justify-content: space-between;
  }
  
  .analytics-card {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.7rem 0.3rem;
  }
  
  .analytics-card span {
    font-size: 1.2rem;
  }
  
  .analytics-card p {
    font-size: 0.7rem;
  }
  
  header {
    padding: 0.8rem 1rem;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  .add-task-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .profile-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  #filters {
    padding: 0.8rem 1rem;
    width: 98%;
    gap: 0.6rem;
  }
  
  .filter-group {
    flex: 1 1 auto;
  }
  
  .filter-group:nth-child(1) {
    flex: 1 1 100%;
    width: 100%;
  }
  
  .filter-group:nth-child(1) input {
    width: 100%;
    min-width: auto;
  }
  
  .filter-group:nth-child(2),
  .filter-group:nth-child(3) {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
  }
  
  .filter-group:nth-child(2) select,
  .filter-group:nth-child(3) input {
    width: 100%;
    min-width: auto;
    font-size: 0.85rem;
  }
  
  #clearFilters {
    flex: 1 1 100%;
    width: auto;
    text-align: center;
    background: transparent;
    color: #5d3fd3;
    border: none;
    border-bottom: none;
    border-radius: 0;
    padding: 0.2rem 0.5rem;
    font-weight: 600;
    line-height: 1.2;
    display: inline-block;
    margin: 0 auto;
  }
  
  #clearFilters:hover {
    color: #836fff;
    background: transparent;
  }
  
  .board {
    width: 98%;
  }
  
  .columns {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .column {
    min-width: 250px;
  }
  
  .task-list {
    max-height: calc(100vh - 400px);
  }
  
  .task {
    padding: 0.6rem 0.8rem;
  }
  
  .task-title {
    font-size: 0.9rem;
  }
  
  .task-desc {
    font-size: 0.9rem;
    font-weight: 700;
  }
  
  .task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }
  
  .category {
    padding: 4px 10px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  
  .task-date {
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  
  .task-action-menu {
    min-width: 140px;
  }
  
  .task-action-menu-item {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .modal {
    align-items: flex-start;
    padding-top: 2rem;
  }
  
  .modal-content {
    width: 90%;
    padding: 1.5rem;
    max-width: 320px;
    margin: 0 auto;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
  
  .modal-content h2 {
    font-size: 1.2rem;
  }
  
  .modal-content input,
  .modal-content select {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
  
  .modal-content select {
    max-width: 100%;
    font-size: 0.85rem;
    max-height: 200px;
  }
  
  .modal-content label {
    font-size: 0.9rem;
  }
  
  .modal-content button {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }
}