@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;700&display=swap");

:root {
  --webApp-width: 600px;
  --radius: 15px;
}

/* Universal box-sizing for all elements */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  align-items: center;
  display: flex;
  margin: 0;
  justify-content: center;
  min-height: 100vh;
  background: url("images/backdrop.png") center;
  background-color: white;
  background-size: cover;
  position: relative;
  width: 100vw;
  min-width: 0;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.15) 100%);
  z-index: 0;
  pointer-events: none;
}

.main-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 3.5rem;
  margin: 3rem auto 0 auto;
  max-width: 1200px;
  width: 100%;
  min-height: 70vh;
  overflow-x: hidden;
}

#pomodoro-container, .webApp {
  min-width: 340px;
  max-width: 440px;
  flex: 1 1 380px;
  border-radius: 22px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.22);
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  margin: 0;
  box-sizing: border-box;
}

#pomodoro-container {
  padding: 3rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  min-height: 420px;
  width: 100%;
  box-sizing: border-box;
}

.webApp {
  width: 100%;
  box-sizing: border-box;
  padding: 1.2rem;
  min-height: 420px;
  position: relative;
  z-index: 1;
}

.list-items {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.13);
  box-shadow: 0 2px 8px rgba(31,38,135,0.07);
  font-size: 1.05rem;
  padding: 0.7rem 0.7rem 0.7rem 0.7rem;
}

.input-row, .priority-controls {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .main-layout {
    gap: 1.5rem;
    max-width: 98vw;
  }
  #pomodoro-container, .webApp {
    min-width: 0;
    max-width: 98vw;
  }
  .webApp {
    padding: 0.7rem;
  }
}

@media (max-width: 900px) {
  .main-layout {
    flex-direction: column;
    align-items: center;
    gap: 2.2rem;
    margin-top: 1.5rem;
  }
  #pomodoro-container, .webApp {
    width: 98vw;
    min-width: 0;
    max-width: 98vw;
  }
  .webApp {
    padding: 0;
  }
  .list-items {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.98rem;
    background: rgba(255,255,255,0.13);
    box-shadow: 0 2px 8px rgba(31,38,135,0.07);
  }
}

@media (max-width: 900px) {
  .main-layout {
    gap: 1rem;
    margin: 0.5rem auto 0 auto;
    min-width: 0;
  }
  #pomodoro-container, .webApp {
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    border-radius: 14px;
    padding: 0.5rem 0.1rem 0.5rem 0.1rem;
  }
  .webApp {
    padding: 0.3rem;
    min-height: 0;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .uncompleted-list, .completed-list {
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .list-items {
    border-radius: 7px;
    font-size: 0.98rem;
    padding: 0.4rem 0.2rem 0.4rem 0.2rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .list-items:last-child {
    border-bottom: none;
  }
  .input-row, .priority-controls {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .pomodoro-title, .webApp h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
}

.webApp {
  color: whitesmoke;
  background: rgba(255,255,255,0.18);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  border-radius: var(--radius);
  border: 1.5px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  width: 100%;
  max-width: var(--webApp-width);
  padding: 2rem;
  position: relative;
  z-index: 1;
  transition: box-shadow 0.3s;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.webApp h1 {
  margin-top: 0;
  margin-bottom: 30px;
  font-size: 45px;
  letter-spacing: 1px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.list-input {
  width: 100%;
  margin-top: -3px;
  margin-bottom: 30px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(255,255,255,0.35);
  padding: 1rem 1.4rem;
  font-size: 20px;
  font-family: "Poppins";
  background: rgba(255,255,255,0.65);
  font-weight: lighter;
  color: #222;
  box-shadow: 0 2px 8px rgba(31,38,135,0.07);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}
.list-input:focus {
  border: 1.5px solid #a1c4fd;
  box-shadow: 0 0 0 2px #a1c4fd33;
}

.list-input::placeholder {
  color: #444;
  opacity: 0.7;
}

.todo-list,
.uncompleted-list,
.completed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-items {
  background: rgba(255,255,255,0.32);
  border-radius: var(--radius);
  border: 1.2px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 24px 0 rgba(31, 38, 135, 0.13);
  padding: 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  padding-bottom: 0.7rem;
  color: #222;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  transition: box-shadow 0.2s, background 0.2s;
}
.list-items:hover {
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
  background: rgba(255,255,255,0.42);
}

.main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.list-items span {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  word-break: break-word;
  flex-wrap: wrap;
  font-size: 1.05rem;
  max-width: 60vw;
  transition: font-size 0.2s;
  flex: 1 1 0;
}

.list-items span.long-text {
  font-size: 0.85rem;
}

.list-items input[type="checkbox"] {
  cursor: pointer;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  accent-color: #a1c4fd;
  border-radius: 6px;
  transition: box-shadow 0.2s;
}

.list-items a {
  color: #555;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  padding: 0.3rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(31,38,135,0.08);
  width: 2.1rem;
  height: 2.1rem;
}

.list-items a:hover, .list-items a:focus {
  background: rgba(255,255,255,0.7);
  box-shadow: 0 4px 16px rgba(161,196,253,0.18);
  transform: scale(1.12);
  color: #d7263d;
}

.list-items a svg {
  width: 1.3rem;
  height: 1.3rem;
  stroke-width: 2.5;
  display: block;
  margin: 0;
  pointer-events: none;
}

.progress-title {
  margin-top: 15px;
  margin-bottom: 15px;
  font-size: 25px;
  font-weight: 550;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.completed-title {
  margin-top: 30px;
  font-size: 25px;
  font-weight: 550;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.completed-list .list-items {
  background: rgba(169, 244, 219, 0.45);
  text-decoration: line-through;
  color: #222;
  border: 1.2px solid rgba(169,244,219,0.35);
}

/* Animations for adding/removing tasks */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}
.list-items {
  animation: fadeIn 0.5s;
}

/* Scrollbar styling for lists */
.uncompleted-list, .completed-list {
  max-height: 40vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #a1c4fd #ffffff33;
}
.uncompleted-list::-webkit-scrollbar, .completed-list::-webkit-scrollbar {
  width: 8px;
}
.uncompleted-list::-webkit-scrollbar-thumb, .completed-list::-webkit-scrollbar-thumb {
  background: #a1c4fd;
  border-radius: 8px;
}

/* Input row for task and priority - embed select inside input */
.input-row {
  display: flex;
  gap: 0.7rem;
  align-items: stretch;
  margin-bottom: 1.2rem;
  width: 100%;
  position: relative;
}
.input-row .list-input {
  flex: 1 1 0;
  padding-right: 9rem;
  position: relative;
}
.input-row .priority-select {
  position: absolute;
  right: 0.7rem;
  top: 33%;
  transform: translateY(-50%);
  min-width: 5.5rem;
  height: 2.2rem;
  z-index: 2;
  background: rgba(255,255,255,0.85);
  border: 6.2px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 8px rgba(31,38,135,0.07);
  font-size: 1rem;
  color: #222;
  border-radius: var(--radius);
  outline: none;
  padding: 0 0.7rem;
  font-family: "Poppins";
}
.input-row .priority-select:focus {
  border: 1.5px solid #a1c4fd;
  box-shadow: 0 0 0 2px #a1c4fd33;
}

/* Priority filter and sort controls */
.priority-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}
.priority-filter {
  border-radius: var(--radius);
  border: 6.5px solid rgba(255,255,255,0.65);
  padding: 0.2rem 1rem;
  font-size: 1rem;
  background: rgba(255,255,255);
  color: #222;
  font-family: "Poppins";
  outline: none;
  box-shadow: 0 2px 8px rgba(31,38,135,0.07);
  transition: border 0.2s, box-shadow 0.2s;
}
.priority-sort {
  border-radius: var(--radius);
  border: 1.2px solid rgba(255,255,255,0.25);
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-family: "Poppins";
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 24px 0 rgba(31, 38, 135, 0.13);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  outline: none;
}
.priority-sort:hover {
  background: rgba(161,196,253,0.32);
  color: #fff;
}

/* Priority badge styles */
.priority-badge {
  display: inline-block;
  margin: 0;
  padding: 0.18em 0.9em;
  border-radius: 999px;
  font-size: 0.65em !important;
  font-weight: 600;
  letter-spacing: 0.03em;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(31,38,135,0.07);
  user-select: none;
  writing-mode: initial;
  text-align: center;
  min-height: unset;
  line-height: 1.2;
  margin-top: 0.3rem;
  align-self: flex-start;
}
.priority-high {
  background: rgba(255, 77, 77, 0.45);
  color: #a1001a;
  border: 1.2px solid #d7263dcc;
  text-shadow: 0 1px 2px #fff8;
}
.priority-medium {
  background: rgba(255, 206, 86, 0.45);
  color: #b97a00;
  border: 1.2px solid #ffb400cc;
  text-shadow: 0 1px 2px #fff8;
}
.priority-low {
  background: rgba(102, 212, 102, 0.45);
  color: #0b5e2a;
  border: 1.2px solid #1fa463cc;
  text-shadow: 0 1px 2px #fff8;
}
.list-items .priority-badge {
  margin-left: 2.5rem;
  margin-bottom: 0.4rem;
}

.right-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1.2rem;
  flex-shrink: 0;
}

#pomodoro-container {
  width: 100%;
  max-width: 420px;
  margin: 2.5rem auto 2rem auto;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  border-radius: 22px;
  background: rgba(255,255,255,0.18);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.22);
  border: 1.5px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

#pomodoro-mode {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 0.7rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

#pomodoro-timer {
  font-size: 3.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.2rem;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

#pomodoro-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
#pomodoro-controls button {
  border-radius: 12px;
  border: 1.2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.32);
  color: #ffffff;
  font-family: "Poppins", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.5rem 1.3rem;
  box-shadow: 0 2px 8px rgba(31,38,135,0.07);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
}
#pomodoro-controls button:hover, #pomodoro-controls button:focus {
  background: #7367f0;
  color: #fff;
  box-shadow: 0 4px 16px rgba(161,196,253,0.18);
}

#pomodoro-session-count {
  font-size: 1rem;
  color: #ffffff;
  margin-top: 0.2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  #pomodoro-container {
    max-width: 98vw;
    padding: 1.2rem 0.5rem 1rem 0.5rem;
  }
  #pomodoro-timer {
    font-size: 2.1rem;
  }
  #pomodoro-controls button {
    font-size: 0.95rem;
    padding: 0.4rem 0.7rem;
  }
}

.pomodoro-title {
  margin-top: 0;
  margin-bottom: 30px;
  font-size: 45px;
  letter-spacing: 1px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
  color: whitesmoke;
  text-align: center;
}

@media (max-width: 700px) {
  .pomodoro-title {
    font-size: 32px;
    margin-bottom: 18px;
  }
}
