:root {
  --primary-color: #033d7c;
  --primary-dark: #0056b3;
  --background-color: #f0f4f8;
  --card-bg: #ffffff;
  --text-color: #34495e;
  --secondary-text-color: #7f8c8d;
  --border-color: #dfe6e9;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --priority-high: #e42c17;
  --priority-medium: #ffd490;
  --priority-low: #58c485;
  --tag-color: #7f8c8d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: "Tajawal", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

.dashboard-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
}

.top-nav {
  background-color: var(--primary-color);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 999;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  border-bottom-color: white;
}

.main-content {
  padding: 30px;
  overflow-y: auto;
  flex-grow: 1;
}

.page {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.page-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stats-card {
  background-color: var(--background-color);
  padding: 25px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stats-card h3 {
  font-size: 1rem;
  color: var(--secondary-text-color);
  margin-bottom: 10px;
}

.stats-card span {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
}

.tasks-summary {
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  box-shadow: var(--shadow);
}

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

.section-header h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.view-all-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
}

.tasks-list-brief {
  list-style: none;
  padding: 0;
}

.tasks-list-brief .task-item {
  border-bottom: 1px solid var(--border-color);
  margin: 20px;
}

.tasks-list-brief .task-item:last-child {
  border-bottom: none;
}

.filter-sort-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-sort-group button,
.filter-sort-group select {
  padding: 8px 12px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: var(--secondary-text-color);
  transition: all 0.3s;
}

.filter-sort-group button.active,
.filter-sort-group button:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.tasks-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.task-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
  opacity: 0.7;
}

.task-info {
  display: flex;
  flex-direction: column;
}

.task-info .task-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-color);
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--secondary-text-color);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  font-size: 0.85rem;
  color: var(--secondary-text-color);
}

.task-meta .priority-label {
  padding: 4px 10px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  text-transform: capitalize;
  font-size: 0.75rem;
}
.task-meta .priority-label.high {
  background-color: var(--priority-high);
}
.task-meta .priority-label.medium {
  background-color: var(--priority-medium);
}
.task-meta .priority-label.low {
  background-color: var(--priority-low);
}

.task-meta .tag-label {
  padding: 4px 10px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: capitalize;
}
.task-meta .tag-label.work {
  background-color: var(--tag-color);
}
.task-meta .tag-label.personal {
  background-color: var(--tag-color);
}
.task-meta .tag-label.study {
  background-color: var(--tag-color);
}
.task-meta .tag-label.general {
  background-color: var(--tag-color);
}

.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 0.3s ease;
}

.task-checkbox:hover {
  border-color: var(--primary-color);
}

.task-checkbox:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.task-checkbox:checked::after {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--secondary-text-color);
  transition: color 0.3s, transform 0.2s;
}

.actions button:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.actions .delete-btn:hover {
  color: var(--priority-high);
}

.task-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 700;
  color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--background-color);
  outline: none;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border: 2px solid var(--primary-color);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.submit-btn {
  background-color: var(--primary-color);
  color: white;
  padding: 15px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background-color 0.3s, transform 0.2s;
}

.submit-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.submit-btn.delete-btn {
  background-color: var(--priority-high);
}

.submit-btn.delete-btn:hover {
  background-color: #c0392b;
}

.notification-center::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

.notification-center,
.modal-content,
.main-content {
  scrollbar-width: none;
}

/* Notification */
.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 10px;
}

.notification-bell i {
  font-size: 1.2rem;
  color: white;
}

.notification-center {
  position: absolute;
  top: 60px;
  right: 20px;
  width: 300px;
  max-height: 400px;
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 15px;
  overflow-y: auto;
  display: none;
  animation: slideDown 0.3s ease-out;
  z-index: 1000;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification-center h4 {
  margin-bottom: 10px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.notification-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notification-item {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-color);
}

.notification-item:last-child {
  border-bottom: none;
}

/* Toast Notification style */
.toast-notification {
  position: fixed;
  top: 75px;
  right: 20px;
  background-color: #ffffff;
  color: var(--text-color);
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 1002;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  max-width: 90%;
  text-align: right;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--card-bg);
  margin: auto;
  padding: 30px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: zoomIn 0.3s ease-in-out;
  overflow: auto;
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close-btn {
  color: var(--secondary-text-color);
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
  color: var(--text-color);
  text-decoration: none;
}

.modal-content h2 {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .top-nav {
    flex-direction: row;
    align-items: center;
    padding: 15px;
  }
  .nav-menu {
    justify-content: flex-end;
    width: auto;
    margin-top: 0;
    flex-grow: 1;
  }
  .nav-item {
    font-size: 0.9rem;
    padding: 10px 5px;
    flex-grow: 0;
    justify-content: center;
  }
  .nav-item span {
    display: inline-block;
    margin-right: 5px;
  }
  .nav-item.active {
    border-bottom-color: white;
  }
  .main-content {
    padding: 20px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .toast-notification {
    top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
  }
}

@media (max-width: 500px) {
  .top-nav {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }
  .logo {
    text-align: center;
    width: 100%;
  }
  .nav-menu {
    justify-content: center;
    width: 100%;
  }
  .nav-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    display: block;
  }
}
