/* Responsive Base Styles */
* {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif, "Open Sans", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* Dark Theme Styles */
body {
  --bg-primary: #ffeadf;
  --bg-secondary: #d0a19d;
  --loader-bg-primary: #1e1e1e;
  --loader-bg-secondary: #16213e;
  --text-primary: #000;
  --text-secondary: #333;
  --button-text: #fff;
  -webkit-transition: background 0.3s ease, color 0.3s ease;
  -o-transition: background 0.3s ease, color 0.3s ease;
  transition: background 0.3s ease, color 0.3s ease;
  background: #d0a19d;
  background: -o-linear-gradient(315deg, #ffeadf, #d0a19d);
  background: linear-gradient(135deg, #ffeadf, #d0a19d);
}

body.dark-theme {
  --bg-primary: #1e1e1e;
  --bg-secondary: #16213e;
  --loader-bg-primary: #ffeadf;
  --loader-bg-secondary: #d0a19d;
  --text-primary: #e5e5e5;
  --text-secondary: #fff;
  --button-text: #000;
  background: #000000;
  background: -o-linear-gradient(315deg, #1a1a1a, #2d3436);
  background: linear-gradient(135deg, #1a1a1a, #2d3436);
  color: var(--text-primary);
}

/* Add glow effect to todo-app in dark mode */
.dark-theme .todo-app {
  -webkit-box-shadow: 0 0 20px rgba(208, 161, 157, 0.3);
  box-shadow: 0 0 20px rgba(208, 161, 157, 0.3);
  -webkit-animation: softGlow 3s infinite alternate;
  animation: softGlow 3s infinite alternate;
}

@-webkit-keyframes softGlow {
  0% {
    -webkit-box-shadow: 0 0 20px rgba(208, 161, 157, 0.3);
    box-shadow: 0 0 20px rgba(208, 161, 157, 0.3);
  }
  100% {
    -webkit-box-shadow: 0 0 40px rgba(208, 161, 157, 0.5);
    box-shadow: 0 0 40px rgba(208, 161, 157, 0.5);
  }
}

@keyframes softGlow {
  0% {
    -webkit-box-shadow: 0 0 20px rgba(208, 161, 157, 0.3);
    box-shadow: 0 0 20px rgba(208, 161, 157, 0.3);
  }
  100% {
    -webkit-box-shadow: 0 0 40px rgba(208, 161, 157, 0.5);
    box-shadow: 0 0 40px rgba(208, 161, 157, 0.5);
  }
}

/* Update button styles for dark mode */
.dark-theme .row button {
  background: #d0a19d;
  color: var(--button-text);
  font-weight: 600;
  -webkit-box-shadow: 0 0 10px rgba(208, 161, 157, 0.3);
  box-shadow: 0 0 10px rgba(208, 161, 157, 0.3);
}

.dark-theme .row button:hover {
  background: #c39693;
  -webkit-box-shadow: 0 0 15px rgba(208, 161, 157, 0.5);
  box-shadow: 0 0 15px rgba(208, 161, 157, 0.5);
}

/* Update Clear All button for dark mode */
#clearAllButton {
  display: block;
  margin: 20px auto 0;
  padding: 10px 20px;
  background-color: #d0a19d;
  color: var(--button-text);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  font-weight: 600;
}

.dark-theme #clearAllButton {
  background-color: #d0a19d;
  color: var(--button-text);
  -webkit-box-shadow: 0 0 10px rgba(208, 161, 157, 0.3);
  box-shadow: 0 0 10px rgba(208, 161, 157, 0.3);
}

#clearAllButton:hover {
  background-color: #b8907f;
}

.dark-theme #clearAllButton:hover {
  background-color: #c39693;
  -webkit-box-shadow: 0 0 15px rgba(208, 161, 157, 0.5);
  box-shadow: 0 0 15px rgba(208, 161, 157, 0.5);
}

/* Improve task text visibility in dark mode */
.dark-theme ul li span {
  color: var(--text-primary);
}

.dark-theme ul li.checked span {
  color: #888;
}

/* Add subtle glow to input field in dark mode */
.dark-theme .row {
  background: #2a2a2a;
  -webkit-box-shadow: 0 0 10px rgba(208, 161, 157, 0.2);
  box-shadow: 0 0 10px rgba(208, 161, 157, 0.2);
}

.dark-theme .row input {
  color: var(--text-primary);
}

.dark-theme .priority-selector {
  background-color: #333;
  color: #fff;
  border: 1px solid #3a3a3a;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23fff' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>");
}

/* Add hover effects to action buttons */
.dark-theme .actions img,
.dark-theme .editActions img {
  -webkit-filter: brightness(0.9);
  filter: brightness(0.9);
  -webkit-transition: -webkit-filter 0.3s ease, -webkit-transform 0.3s ease;
  transition: -webkit-filter 0.3s ease, -webkit-transform 0.3s ease;
  -o-transition: filter 0.3s ease, transform 0.3s ease;
  transition: filter 0.3s ease, transform 0.3s ease;
  transition: filter 0.3s ease, transform 0.3s ease, -webkit-filter 0.3s ease,
    -webkit-transform 0.3s ease;
  transition: filter 0.3s ease, transform 0.3s ease, -webkit-filter 0.3s ease,
    -webkit-transform 0.3s ease;
}

.dark-theme .actions img:hover,
.dark-theme .editActions img:hover {
  -webkit-filter: brightness(1.1);
  filter: brightness(1.1);
  -webkit-transform: scale(1.1);
  -ms-transform: scale(1.1);
  transform: scale(1.1);
}

/* Update editing input style for dark mode */
.dark-theme .editingInput {
  background: #2a2a2a;
  color: var(--text-primary);
  -webkit-box-shadow: 0 0 10px rgba(208, 161, 157, 0.2);
  box-shadow: 0 0 10px rgba(208, 161, 157, 0.2);
}

/* Scrollbar Styles (Keep as is) */
body::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.425);
}

body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.548);
  border-radius: 5px;
}

body::-webkit-scrollbar-thumb:hover {
  background: #000000;
}

/* Responsive Container */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  min-width: 320px; /* Minimum width for mobile devices */
}

/* Theme Toggle Styles */
.theme-toggle {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 25px;
  margin: 0 15px;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.toggle-slot {
  font-size: 8px; /* Reduced font size */
  position: relative;
  height: 25px; /* Reduced height */
  width: 45px; /* Reduced width */
  border: 0px solid transparent;
  border-radius: 20px;
  background-color: #ffffff;
  -webkit-transition: background-color 250ms;
  -o-transition: background-color 250ms;
  transition: background-color 250ms;
}

.toggle-checkbox:checked ~ .toggle-slot {
  background-color: #374151;
}

.toggle-button {
  -webkit-transform: translate(0.2em, 0.3em);
  -ms-transform: translate(0.2em, 0.3em);
  transform: translate(0.2em, 0.3em);
  position: absolute;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background-color: #ffeccf;
  -webkit-box-shadow: inset 0px 0px 0px 0.5em #ffbb52;
  box-shadow: inset 0px 0px 0px 0.5em #ffbb52;
  -webkit-transition: background-color 250ms, border-color 250ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: background-color 250ms, border-color 250ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  -o-transition: background-color 250ms, border-color 250ms,
    transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: background-color 250ms, border-color 250ms,
    transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: background-color 250ms, border-color 250ms,
    transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71),
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: background-color 250ms, border-color 250ms,
    transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71),
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
}

.toggle-checkbox:checked ~ .toggle-slot .toggle-button {
  background-color: #485367;
  -webkit-box-shadow: inset 0px 0px 0px 0.5em white;
  box-shadow: inset 0px 0px 0px 0.5em white;
  -webkit-transform: translate(3em, 0.25em);
  -ms-transform: translate(3em, 0.25em);
  transform: translate(3em, 0.25em);
}

.sun-icon-wrapper,
.moon-icon-wrapper {
  position: absolute;
  opacity: 1;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

.sun-icon {
  color: #ffbb52;
  width: 100%;
  height: 100%;
}

.moon-icon {
  color: white;
  width: 100%;
  height: 100%;
}

.sun-icon-wrapper {
  -webkit-transform: translate(-50%, -50%) rotate(15deg);
  -ms-transform: translate(-50%, -50%) rotate(15deg);
  transform: translate(-50%, -50%) rotate(15deg);
  -webkit-transition: opacity 150ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: opacity 150ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  -o-transition: opacity 150ms,
    transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  -webkit-transition: opacity 150ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: opacity 150ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  -o-transition: opacity 150ms,
    transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: opacity 150ms, transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: opacity 150ms, transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71),
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
  transition: opacity 150ms, transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71),
    -webkit-transform 500ms cubic-bezier(0.26, 2, 0.46, 0.71);
}

.toggle-checkbox:checked ~ .toggle-slot .sun-icon-wrapper {
  opacity: 0;
  -webkit-transform: translate(-50%, -50%) rotate(0deg);
  -ms-transform: translate(-50%, -50%) rotate(0deg);
  transform: translate(-50%, -50%) rotate(0deg);
}

.moon-icon-wrapper {
  opacity: 0;
  -webkit-transform: translate(-50%, -50%) rotate(0deg);
  -ms-transform: translate(-50%, -50%) rotate(0deg);
  transform: translate(-50%, -50%) rotate(0deg);
  -webkit-transition: opacity 150ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
  transition: opacity 150ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
  -o-transition: opacity 150ms,
    transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
  -webkit-transition: opacity 150ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
  transition: opacity 150ms,
    -webkit-transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
  -o-transition: opacity 150ms,
    transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
  transition: opacity 150ms, transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
  transition: opacity 150ms, transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71),
    -webkit-transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
  transition: opacity 150ms, transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71),
    -webkit-transform 500ms cubic-bezier(0.26, 2.5, 0.46, 0.71);
}

.toggle-checkbox:checked ~ .toggle-slot .moon-icon-wrapper {
  opacity: 1;
  -webkit-transform: translate(-50%, -50%) rotate(-15deg);
  -ms-transform: translate(-50%, -50%) rotate(-15deg);
  transform: translate(-50%, -50%) rotate(-15deg);
}

.container {
  width: 100%;
  min-height: 100vh;
  padding: 10px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start;
  padding-top: 30px;
}

.todo-app {
  width: 95%;
  max-width: 540px;
  background-color: #ffeadf;
  margin: 20px auto;
  padding: 20px;
  border-radius: 10px;
  -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive Header */
.todo-app h2 {
  color: #d0a19d;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  margin-bottom: 20px;
}

.todo-app h2 .innerTitle {
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  flex-grow: 1;
  margin-right: 10px;
}

.todo-app h2 .image {
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  height: 3.5rem;
  margin-left: 10px;
}

.todo-app .dateSpan {
  font-size: 12px;
  color: #000000;
  display: block;
  margin-top: 5px;
}

/* Responsive Greeting */
.todo-app .greetingContainer {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  margin-bottom: 15px;
}

.editUserName {
  height: 25px;
  width: 25px;
  cursor: pointer;
}

.install-app {
  height: 25px;
  width: 25px;
  cursor: pointer;
}

/* Responsive Input Row */
.row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 10px;
  background: #edeef0;
  border-radius: 35px;
  padding: 20px;
  margin-bottom: 25px;
  width: 100%; /* Ensure full width */
  -webkit-box-sizing: border-box;
  box-sizing: border-box; /* Include padding in width calculation */
  max-width: 100%; /* Prevent overflow */
  overflow: hidden; /* Hide any potential overflow */
}

.row input {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px;
  font-size: 1rem;
  min-width: 0; /* Allow input to shrink */
  width: 100%; /* Ensure input takes available space */
}

.actions-container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
  gap: 5px;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.row button {
  border: none;
  outline: none;
  padding: 16px 30px;
  background: #d0a19d;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  border-radius: 40px;
  -webkit-transition: 0.5s;
  -o-transition: 0.5s;
  transition: 0.5s;
  white-space: nowrap;
  -ms-flex-negative: 0;
  flex-shrink: 0; /* Prevent button from shrinking too much */
}

.row button:active {
  -webkit-transform: scale(0.9);
  -ms-transform: scale(0.9);
  transform: scale(0.9);
}

/* Responsive List Items */
ul li {
  list-style: none;
  font-size: 16px;
  padding: 12px 8px 12px 50px;
  cursor: pointer;
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  width: 100%;
  overflow: hidden; /* Prevent any potential overflow */
}

ul li span {
  white-space: nowrap;
  overflow: hidden;
  -o-text-overflow: ellipsis;
  text-overflow: ellipsis;
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  flex-grow: 1;
  -ms-flex-preferred-size: 0;
  flex-basis: 0; /* Ensures equal distribution of available space */
  margin-right: 10px; /* Space between text and action icons */
  min-width: 0; /* Crucial for flex-based truncation */
  max-width: 100%; /* Ensure it doesn't overflow its container */
}

ul li .actions {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-negative: 0;
  flex-shrink: 0; /* Prevent action icons from shrinking */
}

ul li::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background-image: url(../assets/unchecked.png);
  background-size: cover;
  top: 12px;
  left: 8px;
}

ul li.checked::before {
  background-image: url(../assets/checked.png);
}

ul li.checked span {
  color: #555;
  text-decoration: line-through;
  max-width: 100%; /* Ensure truncation works for checked items too */
}

/* Responsive Actions */
.actions {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.actions img {
  margin: 0 10px;
  width: 25px;
  height: 25px;
  cursor: pointer;
}

/* Responsive Edit Mode */
.editRow {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  width: 100%;
  background: #edeef0;
  border-radius: 10px;
  padding: 5px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  gap: 10px; /* Replaces margin with more flexible spacing */
  max-width: 100%;
  overflow: hidden;
}

.editingInput {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  background: transparent;
  border: none;
  padding: 5px;
  font-size: 16px;
  min-width: 0; /* Allow input to shrink */
}

.editActions {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-negative: 0;
  flex-shrink: 0; /* Prevent actions from shrinking */
  gap: 20px; /* Consistent spacing between icons */
}

.editActions img {
  width: 25px;
  height: 25px;
  cursor: pointer;
  -ms-flex-negative: 0;
  flex-shrink: 0; /* Prevent individual icons from shrinking */
}

/* Light Theme (Default) Styles */
.task-details-modal {
  font-family: "Poppins", sans-serif;
  color: var(--text-primary);
  -webkit-transition: background 0.3s ease, color 0.3s ease;
  -o-transition: background 0.3s ease, color 0.3s ease;
  transition: background 0.3s ease, color 0.3s ease;
}

.task-details-modal.light-theme {
  --modal-bg: #ffffff;
  --modal-text-primary: #2c3e50;
  --modal-text-secondary: #7f8c8d;
  --modal-border: #e0e0e0;
  --modal-shadow: rgba(0, 0, 0, 0.05);
  --modal-section-bg: #f9f9f9;
}

.task-details-modal.dark-theme {
  --modal-bg: #2d3436;
  --modal-text-primary: #e5e5e5;
  --modal-text-secondary: #a0a0a0;
  --modal-border: #3a3a3a;
  --modal-shadow: rgba(255, 255, 255, 0.05);
  --modal-section-bg: #1e1e1e;
}

.task-header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  border-bottom: 2px solid var(--modal-border);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.task-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--modal-text-primary);
  font-weight: 600;
}

.task-status {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.task-status.completed {
  background-color: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}

.task-status.pending {
  background-color: rgba(241, 196, 15, 0.1);
  color: #f1c40f;
}

.task-content {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 15px;
}

.task-section {
  background-color: var(--modal-section-bg);
  border-radius: 8px;
  padding: 15px;
  -webkit-box-shadow: 0 2px 5px var(--modal-shadow);
  box-shadow: 0 2px 5px var(--modal-shadow);
}

.section-label {
  font-size: 14px;
  color: var(--modal-text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
}

.section-content {
  font-size: 16px;
  color: var(--modal-text-primary);
}

.task-text {
  line-height: 1.6;
  word-break: break-word;
}

.date-created {
  color: var(--modal-text-primary);
  opacity: 0.8;
}

/* Sweetalert specific styling */
.task-modal-popup {
  border-radius: 15px !important;
  padding: 20px !important;
}

/* Light and Dark Theme Styles for Developer Credits */
.developer-credits-modal {
  font-family: "Poppins", sans-serif;
  -webkit-transition: background 0.3s ease, color 0.3s ease;
  -o-transition: background 0.3s ease, color 0.3s ease;
  transition: background 0.3s ease, color 0.3s ease;
}

.developer-credits-modal.light-theme {
  --credits-bg: #ffffff;
  --credits-text-primary: #2c3e50;
  --credits-text-secondary: #34495e;
  --credits-link-color: #3498db;
  --credits-link-hover: #2980b9;
  --credits-border: #e0e0e0;
}

.developer-credits-modal.dark-theme {
  --credits-bg: #2d3436;
  --credits-text-primary: #e5e5e5;
  --credits-text-secondary: #a0a0a0;
  --credits-link-color: #5dade2;
  --credits-link-hover: #3498db;
  --credits-border: #3a3a3a;
}

.developer-credits-container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 20px;
  padding: 20px;
  text-align: center;
}

.developer-credits-header {
  font-size: 24px;
  font-weight: 700;
  color: var(--credits-text-primary);
  border-bottom: 2px solid var(--credits-border);
  padding-bottom: 15px;
  width: 100%;
}

.developer-credits-content {
  font-size: 16px;
  line-height: 1.6;
  color: var(--credits-text-secondary);
  max-width: 500px;
}

.developer-credits-link {
  color: var(--credits-link-color);
  text-decoration: none;
  font-weight: 600;
  -webkit-transition: color 0.3s ease;
  -o-transition: color 0.3s ease;
  transition: color 0.3s ease;
}

.developer-credits-link:hover {
  color: var(--credits-link-hover);
  text-decoration: underline;
}

.developer-credits-emoji {
  font-size: 24px;
  margin-left: 5px;
}

/* CPage Powered By Card Styles */
.cpage-powered-by {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 100%;
  margin-top: 15px;
}

.cpage-card {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 8px;
  background-color: var(--credits-border);
  -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  -webkit-transition: background-color 0.3s ease, -webkit-transform 0.2s ease;
  transition: background-color 0.3s ease, -webkit-transform 0.2s ease;
  -o-transition: background-color 0.3s ease, transform 0.2s ease;
  transition: background-color 0.3s ease, transform 0.2s ease;
  transition: background-color 0.3s ease, transform 0.2s ease,
    -webkit-transform 0.2s ease;
  transition: background-color 0.3s ease, transform 0.2s ease,
    -webkit-transform 0.2s ease;
}

.cpage-card:hover {
  -webkit-transform: scale(1.02);
  -ms-transform: scale(1.02);
  transform: scale(1.02);
}

.cpage-logo {
  width: 27.5px;
  height: 35px;
}

.cpage-text {
  font-size: 14px;
  color: var(--credits-text-secondary);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 5px;
}

.cpage-link {
  color: var(--credits-link-color);
  text-decoration: none;
  font-weight: 600;
  -webkit-transition: color 0.3s ease;
  -o-transition: color 0.3s ease;
  transition: color 0.3s ease;
}

.cpage-link:hover {
  color: var(--credits-link-hover);
  text-decoration: underline;
}

/* Media Queries for Different Screen Sizes */
/* Media query for very small screens */
@media (max-width: 400px) {
  .row {
    padding: 15px;
  }

  .actions-container {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .row input {
    width: 100%;
    margin-bottom: 5px;
    padding: 10px 0;
  }

  .priority-selector {
    width: 100%;
    padding: 10px 15px;
  }

  .row button {
    width: 100%;
    padding: 10px;
  }

  .editRow {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    padding: 10px;
  }

  .editingInput {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 0;
  }

  .editActions {
    width: 100%;
    -ms-flex-pack: distribute;
    justify-content: space-around;
  }

  .cpage-card {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 15px;
  }

  .cpage-logo {
    width: 27.5px;
    height: 35px;
  }
}

@media (max-width: 480px) {
  .actions img,
  .editActions img {
    width: 25px; /* Even larger on very small screens */
    height: 25px;
    gap: 15px;
  }
}

/* Small devices (phones) */
@media screen and (min-width: 401px) and (max-width: 480px) {
  .todo-app {
    width: 98%;
    padding: 15px;
    margin: 10px auto;
  }

  .row button {
    padding: 12px 20px;
    font-size: 14px;
  }

  ul li {
    font-size: 14px;
    padding: 10px 8px 10px 40px;
  }

  ul li::before {
    height: 20px;
    width: 20px;
    top: 10px;
  }
}

@media (max-width: 600px) {
  .container {
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start; /* Ensure content starts from near the top */
    padding-top: 25%; /* Reduce padding on smaller screens */
  }

  .todo-container {
    width: 90%; /* Make the todo container slightly narrower on mobile */
    max-width: 350px; /* Set a max-width to prevent it from getting too wide */
  }
}

@media (max-width: 768px) {
  .actions img,
  .editActions img {
    width: 25px; /* Larger size for easier tapping on mobile */
    height: 25px;
  }
}

/* Medium devices (tablets) */
@media screen and (min-width: 481px) and (max-width: 768px) {
  .todo-app {
    width: 90%;
    padding: 25px;
  }

  .row button {
    padding: 14px 25px;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
  }

  .container {
    background: none;
  }

  .todo-app {
    -webkit-box-shadow: none;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Priority Filters */
.priority-filters {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 8px;
  margin: 15px 0;
  padding: 6px;
  border-radius: 10px;
  background: rgba(208, 161, 157, 0.15);
  -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.priority-tab {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  padding: 8px 15px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  -webkit-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  -o-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-align: center;
}

/* Priority Flags */
.priority-flag {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8em;
  margin-left: 10px;
  font-weight: 500;
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.priority-high {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.priority-medium {
  background: rgba(255, 159, 10, 0.15);
  color: #ff9f0a;
  border: 1px solid rgba(255, 159, 10, 0.3);
}

.priority-low {
  background: rgba(48, 209, 88, 0.15);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

/* Task Stats */
.task-stats {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-pack: distribute;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(208, 161, 157, 0.12);
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.stat-item {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 8px;
  padding: 5px 15px;
  border-radius: 8px;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(208, 161, 157, 0.2);
}

.stat-emoji {
  font-size: 1.3em;
}

.stat-count {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1em;
}

/* Animations - Enhanced with smoother curves */
@-webkit-keyframes slideIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(25px);
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(25px);
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@-webkit-keyframes scaleIn {
  from {
    opacity: 0;
    -webkit-transform: scale(0.92);
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    -webkit-transform: scale(0.92);
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

@-webkit-keyframes pulseAnimation {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  50% {
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

@keyframes pulseAnimation {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  50% {
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

/* Enhanced transitions */
body,
.todo-app,
button,
input {
  -webkit-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  -o-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Adding animated focus states for inputs */
input:focus {
  -webkit-box-shadow: 0 0 0 2px rgba(208, 161, 157, 0.5);
  box-shadow: 0 0 0 2px rgba(208, 161, 157, 0.5);
  outline: none;
}

/* Add gentle hover state for buttons */
button:hover {
  -webkit-transform: translateY(-2px);
  -ms-transform: translateY(-2px);
  transform: translateY(-2px);
  -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active {
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
}

.priority-selector {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  border: none;
  outline: none;
  background: #fff;
  padding: 16px 20px;
  font-size: 16px;
  border-radius: 40px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) center;
  padding-right: 32px;
}
.priority-selector:hover,
.priority-selector:focus {
  border-color: #e4a6a6;
  outline: none;
}

/* For small screens */
@media (max-width: 768px) {
  .priority-selector {
    padding: 6px 10px;
    font-size: 13px;
    width: 100%;
  }
}

/* Custom styling for options */
.priority-selector option {
  background-color: #2a2a2a;
  color: #fff;
  padding: 8px;
}

/* For high, medium, low priority options */
.priority-selector option[value="high"] {
  color: #ff7676;
}

.priority-selector option[value="medium"] {
  color: #76a9ff;
}

.priority-selector option[value="low"] {
  color: #76ff9c;
}

/* Counter stats animation */
@-webkit-keyframes pulse {
  0% {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
@keyframes pulse {
  0% {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

/* Apply animation when updating stats */
.stats-updating {
  -webkit-animation: pulse 450ms ease-in-out;
  animation: pulse 450ms ease-in-out;
}

/* Base Toggle Switch Styles */
.switch-toggle {
  position: relative;
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  background: var(--toggle-bg, #2d3033);
  border-radius: 30px;
  padding: 4px;
  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3),
    0 1px rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  line-height: 1;
  width: 100%;
  max-width: 300px;
  min-width: 200px;
  min-height: 36px;
}

/* Hide the radio buttons */
.switch-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Label styles */
.switch-toggle label {
  position: relative;
  z-index: 2;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  text-align: center;
  padding: 8px 0;
  color: var(--label-color, #aaa);
  cursor: pointer;
  -webkit-transition: color 0.3s ease;
  -o-transition: color 0.3s ease;
  transition: color 0.3s ease;
  border-radius: 25px;
  margin: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  font-weight: 500;
}

/* Moving indicator */
.switch-toggle a {
  position: absolute;
  z-index: 1;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: 25px;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-box-shadow: var(--indicator-shadow, 0 1px 2px rgba(0, 0, 0, 0.2));
  box-shadow: var(--indicator-shadow, 0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Indicator positions */
.switch-toggle input#on:checked ~ a {
  left: 4px;
  width: calc(33.33% - 6px);
  background: var(--done-color, #4caf50);
}

.switch-toggle input#na:checked ~ a {
  left: calc(33.33% + 2px);
  width: calc(33.33% - 6px);
  background: var(--all-color, #ffae42);
}

.switch-toggle input#off:checked ~ a {
  left: calc(66.66% + 0px);
  width: calc(33.33% - 6px);
  background: var(--pending-color, #f44336);
}

/* Selected label text color */
.switch-toggle input:checked + label {
  color: var(--selected-text, #fff);
}

/* Dark theme (default) */
:root {
  --toggle-bg: #2d3033;
  --label-color: #aaa;
  --selected-text: #fff;
  --done-color: #4caf50;
  --all-color: #ffae42;
  --pending-color: #f44336;
  --indicator-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Enhanced Light theme */
.light-theme .switch-toggle {
  --toggle-bg: #f5f5f7;
  --label-color: #777;
  --selected-text: #fff;
  --done-color: #68c278;
  --all-color: #ffb861;
  --pending-color: #ff6b6b;
  --indicator-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08),
    0 1px rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08),
    0 1px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Ensure hover effect is smooth */
.switch-toggle label:hover {
  color: var(--selected-text);
}

/* Label hover effects */
.light-theme .switch-toggle label:hover {
  color: #555;
}

.light-theme .switch-toggle input:checked + label:hover {
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .switch-toggle {
    max-width: 100%;
    min-width: 150px;
  }

  .switch-toggle label {
    font-size: 11px;
    padding: 6px 0;
  }
}

/* Active state subtle animations */
.switch-toggle input:active + label {
  -webkit-transform: scale(0.97);
  -ms-transform: scale(0.97);
  transform: scale(0.97);
}

.light-theme .switch-toggle a {
  -webkit-transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -o-transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.forLoaderOnly {
  list-style: none;
  padding: 0;
  margin: 0;
  display: -ms-grid;
  display: grid;
  place-items: center;
  min-height: 200px;
}

/* HTML: <div class="loader"></div> */
.loader {
  width: 40px;
  height: 20px;
  --c: no-repeat
    radial-gradient(
      farthest-side,
      var(--loader-bg-primary) 93%,
      var(--loader-bg-secondary)
    );
  background: var(--c) 0 0, var(--c) 50% 0, var(--c) 100% 0;
  background-size: 8px 8px;
  position: relative;
  -webkit-animation: l4-0 1s linear infinite alternate;
  animation: l4-0 1s linear infinite alternate;
}

.loader:before {
  content: "";
  position: absolute;
  width: 8px;
  height: 12px;
  background: var(--loader-bg-secondary);
  left: 0;
  top: 0;
  -webkit-animation: l4-1 1s linear infinite alternate,
    l4-2 0.5s cubic-bezier(0, 200, 0.8, 200) infinite;
  animation: l4-1 1s linear infinite alternate,
    l4-2 0.5s cubic-bezier(0, 200, 0.8, 200) infinite;
}

@-webkit-keyframes l4-0 {
  0% {
    background-position: 0 100%, 50% 0, 100% 0;
  }
  8%,
  42% {
    background-position: 0 0, 50% 0, 100% 0;
  }
  50% {
    background-position: 0 0, 50% 100%, 100% 0;
  }
  58%,
  92% {
    background-position: 0 0, 50% 0, 100% 0;
  }
  100% {
    background-position: 0 0, 50% 0, 100% 100%;
  }
}

@keyframes l4-0 {
  0% {
    background-position: 0 100%, 50% 0, 100% 0;
  }
  8%,
  42% {
    background-position: 0 0, 50% 0, 100% 0;
  }
  50% {
    background-position: 0 0, 50% 100%, 100% 0;
  }
  58%,
  92% {
    background-position: 0 0, 50% 0, 100% 0;
  }
  100% {
    background-position: 0 0, 50% 0, 100% 100%;
  }
}
@-webkit-keyframes l4-1 {
  100% {
    left: calc(100% - 8px);
  }
}
@keyframes l4-1 {
  100% {
    left: calc(100% - 8px);
  }
}
@-webkit-keyframes l4-2 {
  100% {
    top: -0.1px;
  }
}
@keyframes l4-2 {
  100% {
    top: -0.1px;
  }
}
