:root {
  --primary: #1e3a8a;
  --secondary: #3b82f6;
  --accent: #2563eb;
  --text: #1f2937;
  --bg: #f3f4f6;
  --card-bg: rgba(255, 255, 255, 0.9);
  --shadow: rgba(0, 0, 0, 0.15);
  --gradient: linear-gradient(135deg, #3b82f6, #2563eb);
}

[data-theme="dark"] {
  --primary: #1e40af;
  --secondary: #1e3a8a;
  --accent: #60a5fa;
  --text: #d1d5db;
  --bg: #111827;
  --card-bg: rgba(31, 41, 55, 0.9);
  --shadow: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
  line-height: 1.7;
}

header {
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px var(--shadow);
}

.logo {
  font-family: "Poppins", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: color 0.3s ease;
}

nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}

nav a:hover::after,
nav a:focus::after {
  width: 100%;
}

nav a:hover,
nav a:focus {
  color: var(--accent);
}

.theme-toggle {
  display: flex;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.theme-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  color: #fff;
}

.theme-icon.sun {
  display: block;
}

.theme-icon.moon {
  display: none;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

input:checked + .slider .sun {
  display: none;
}

input:checked + .slider .moon {
  display: block;
}

.container {
  display: flex;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 2rem;
  gap: 2rem;
}

.sidebar {
  flex: 0 0 220px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
  position: sticky;
  top: 80px;
}

main {
  flex: 1;
}

section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow: 0 4px 12px var(--shadow);
}

h2 {
  font-family: "Poppins", sans-serif;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.selector {
  margin-bottom: 1.5rem;
}

.selector label {
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  display: block;
  margin-bottom: 0.5rem;
}

select,
input[type="text"] {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--shadow);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
  outline: none;
}

.goal-input .form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.input-group {
  position: relative;
  flex: 1;
  min-width: 140px;
}

.input-group input {
  padding: 0.8rem;
}

.input-group label {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  font-size: 0.95rem;
  color: var(--text);
  transform: translateY(-50%);
  transition: all 0.3s ease;
  pointer-events: none;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 0.75rem;
  background: var(--card-bg);
  padding: 0 0.2rem;
  transform: translateY(-100%);
}

.cta {
  padding: 0.8rem 1.5rem;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px var(--shadow);
  animation: pulse 1.5s infinite;
}

.cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.cta:hover::before {
  left: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.goal {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.goal:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
}

.goal.completed {
  background: rgba(52, 211, 153, 0.1);
}

.goal span {
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  display: block;
  margin-bottom: 0.5rem;
}

.goal .actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.goal button {
  padding: 0.5rem 1rem;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.goal button:hover {
  background: var(--accent);
}

.timetable .grid,
.report .grid {
  grid-template-columns: 1fr;
}

.timetable ul {
  list-style: none;
  padding-left: 1rem;
}

.timetable li {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.report p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 1rem;
  max-width: 500px;
  box-shadow: 0 8px 20px var(--shadow);
  text-align: center;
}

.modal-content h3 {
  font-family: "Poppins", sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-content .cta {
  margin: 0.5rem;
}

.report-entry {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 0 1rem;
  }
  .sidebar {
    position: static;
    flex: 1;
  }
  header {
    padding: 0.8rem 3%;
    flex-direction: column;
    gap: 0.8rem;
  }
  .logo {
    font-size: 1.5rem;
  }
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  .goal-input .form {
    flex-direction: column;
    align-items: stretch;
  }
  .input-group {
    min-width: 100%;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  section {
    padding: 1.5rem;
  }
}
