
/* Global reset */
*, *::before, *::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #121212;
  --bg-light: #f9f9f9;
  --text-dark: #eeeeee;
  --text-light: #1a1a1a;
  --accent: #4caf50;
  --accent-hover: #388e3c;
  --toast-bg: rgba(50, 50, 50, 0.95);
  --btn-bg: #2d2d2d;
  --btn-hover-bg: #4caf50;
  --btn-color: #f0f0f0;
  --border-radius: 8px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

[data-theme="light"] {
  background-color: var(--bg-light);
  color: var(--text-light);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sticky nav */
.main-nav {
  position: sticky;
  top: 0;
  background-color: #111;
  z-index: 1000;

  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1rem 0;
  width: 100%;
  border-bottom: 1px solid #333;
}

/* Header styling */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #111;
  color: #ccc;
  padding: 1rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  width: 100%;
}

/* Header title section */
.header-title {
  padding: 1rem 1.5rem;
  background-color: var(--btn-bg, #222);
  color: var(--btn-color, #fff);
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  font-weight: 700;
  font-size: 1.5rem;
  box-shadow: var(--shadow, 0 2px 5px rgba(0, 0, 0, 0.2));
}

/* Title text */
.header-title h1 {
  margin: 0;
}

/* Theme toggle button */
#theme-toggle {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: inherit;
  transition: transform 0.2s ease;
}
#theme-toggle:hover {
  transform: scale(1.2);
}

/* Navigation links */
.header-link {
  color: #fff;
  text-decoration: none;
  position: relative;
  display: inline-block;
  font-size: 1.2rem;
  transition: color 0.3s ease;
  font-weight: bold;
}
.header-link:visited {
  color: #fff;
}
.header-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background-color: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.header-link:hover {
  color: #007bff;
}
.header-link:hover::after {
  transform: scaleX(1);
}


main {
  flex-grow: 1;
  padding: 1rem 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

#add-task-section {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

#add-task-section input,
#add-task-section select {
  flex-grow: 1;
  min-width: 130px;
  padding: 0.6rem;
  border: 1px solid #555;
  border-radius: var(--border-radius);
  font-size: 1rem;
  background-color: transparent;
  color: inherit;
  transition: border 0.3s ease;
}
#add-task-section input:focus,
#add-task-section select:focus {
  border-color: var(--accent);
  outline: none;
}

#add-task-btn {
  padding: 0.6rem 1.2rem;
  background-color: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: background-color 0.3s ease, transform 0.2s ease;
}
#add-task-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.02);
}

#task-list,
#history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid #444;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  transition: transform 0.2s ease;
}
.task-item:hover {
  transform: translateY(-2px);
}

.task-item.completed {
  opacity: 0.6;
}
.task-item.completed .task-title {
  text-decoration: line-through;
}

.task-left {
  flex-grow: 1;
  min-width: 200px;
}

.task-title {
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.task-info {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 0.2rem;
}

.task-info:last-child {
  font-weight: 500;
  color: #999;
}

.task-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: 1rem;
  margin-top: 0.5rem;
  flex-shrink: 0;
}

.task-actions button {
  background-color: var(--btn-bg);
  color: var(--btn-color);
  border: none;
  cursor: pointer;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  padding: 0.4rem 0.7rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.task-actions button:hover {
  background-color: var(--btn-hover-bg);
  transform: scale(1.05);
}
.timer-btn.running {
  background-color: #e53935;
  color: #fff;
}

#stats-section {
  margin-top: 1rem;
  font-size: 1.1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #444;
}

#history-section {
  margin-top: 2rem;
}

#history-date-select {
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.7rem;
  border-radius: var(--border-radius);
  border: 1px solid #555;
  background-color: transparent;
  color: inherit;
  font-size: 1rem;
  width: 100%;
  max-width: 300px;
}

#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-color);
  padding: 0.7rem 1.2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 500px) {
  #add-task-section {
    flex-direction: column;
  }
  .task-actions {
    margin-left: 0;
    margin-top: 0.5rem;
  }
  .task-left {
    min-width: 100%;
  }
}

/* Progress Bar */
.progress-container {
  margin-top: 0.4rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #333;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  transition: width 0.4s ease;
}

/* FOOTER BASE STYLES */
.site-footer {
  background-color: #111;
  color: #ccc;
  padding: 1rem 2rem;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* LINK STYLING */
.footer-link {
  color: #4eaaff;
  text-decoration: none;
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

/* REMOVE DEFAULT VISITED COLOR */
.footer-link:visited {
  color: #4eaaff;
}

/* HOVER EFFECT - SLIDE UNDERLINE */
.footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: #4eaaff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.footer-link:hover {
  color: #ffffff;
}

.footer-link:hover::after {
  transform: scaleX(1);
}
