/* variables */
:root {
  --bg-color: #fafafa;
  --text-color: #2c2c2c;
  --nav-bg-color: #f5f5f5;
  --nav-bg: #800000;
  --nav-active-bg: #a02020;
  --nav-text: #f0f0f0;
  --link-color: #2c2c2c;
  --accent-color: #d42f2f;
  --card-bg: #fefefe;
  --input-bg: #f8f8f8;
  --chat-bg-1: #f0f0f0;
  --chat-bg-2: #e8e8e8;
}

:root.dark-mode {
  --bg-color: #121212;
  --text-color: #f0f0f0;
  --nav-bg-color: #1e1e1e;
  --link-color: #f0f0f0;
  --card-bg: #2b2b2b;
  --input-bg: #333333;
  --chat-bg-1: #2f2f2f;
  --chat-bg-2: #3a3a3a;
}


/* base */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  height: 100%;
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background 0.3s, color 0.3s;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  padding-top: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 0 auto;
}

.milo-page-main {
  width: 100%;
  box-sizing: border-box;
}

button, input, textarea {
  font-family: inherit;
}

@media (max-width: 768px) {
  button, input, textarea {
    -webkit-tap-highlight-color: transparent;
  }
  
  button:active {
    transform: scale(0.98);
  }
  
  input, textarea {
    font-size: 16px;
  }
}


/* nav */
.sticky-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  backdrop-filter: blur(6px);
  padding-top: 1rem;
}

.centered-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1.5rem 1em;
  font-size: 1rem;
  font-weight: 500;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}



.nav-links {
  display: flex;
  gap: 2.5rem;
  justify-content: flex-start;
  flex: 0;
}

.centered-nav a {
  text-decoration: none;
  color: var(--text-color);
  transition: opacity 0.3s ease;
}

.centered-nav a:hover,
.centered-nav a.active {
  opacity: 0.6;
  font-weight: 600;
  color: var(--accent-color);
}

.nav-links > a {
  color: var(--text-color);
  background: transparent;
  padding: 0.5em 1em;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.nav-links > a:hover {
  opacity: 0.9;
  background: rgba(128, 0, 0, 0.12);
}

.nav-links > a.active {
  background: var(--nav-active-bg);
  color: var(--nav-text);
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-weight: 600;
  opacity: 1;
}

.theme-toggle-nav {
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.6em 0.85em;
  border-radius: 8px;
  transition: opacity 0.3s ease, color 0.3s ease;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.theme-toggle-nav:hover {
  opacity: 0.85;
}

.theme-toggle-nav svg {
  width: 1.45em;
  height: 1.45em;
}

.theme-toggle-nav .theme-icon-sun { display: none; }
.theme-toggle-nav .theme-icon-moon { display: none; }
.theme-toggle-nav[data-theme="dark"] .theme-icon-sun { display: block; }
.theme-toggle-nav[data-theme="light"] .theme-icon-moon { display: block; }

.person-nav {
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.6em 0.85em;
  border-radius: 8px;
  transition: opacity 0.3s ease, color 0.3s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.person-nav:hover {
  opacity: 0.85;
}

.person-nav svg {
  width: 1.45em;
  height: 1.45em;
}

.person-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 160px;
  z-index: 9999;
  display: none;
  overflow: hidden;
}

:root.dark-mode .person-dropdown {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.person-dropdown.show {
  display: block !important;
}

.person-dropdown a {
  display: block;
  padding: 0.7rem 1.1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.person-dropdown a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

:root.dark-mode .person-dropdown a:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.person-dropdown .divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0.25rem 0.75rem;
  padding: 0;
  border: none;
  flex-shrink: 0;
}

:root.dark-mode .person-dropdown .divider {
  background: rgba(255, 255, 255, 0.1);
}


/* hero */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2em;
}

.hero-image {
  width: 280px;
  margin-bottom: 0;
  border-radius: 12px;
}

.hero h1 {
  font-size: 4em;
  margin-bottom: 0;
  margin-top: -0.05em;
}

.hero p {
  font-size: 1.6em;
  margin-bottom: 1em;
  margin-top: 0.5em;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
}

.cta-button,
.secondary-button {
  font-size: 1.2em;
  padding: 0.8em 2em;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.cta-button {
  background-color: var(--accent-color);
  color: white;
  border: none;
}

.cta-button:hover {
  background-color: #b12727;
}

.secondary-button {
  background-color: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.secondary-button:hover {
  background-color: var(--accent-color);
  color: white;
}

.scroll-down {
  margin-top: 1.5rem;
  font-size: 1.5em;
  opacity: 0.7;
  animation: bounce 2s infinite;
  cursor: pointer;
  transition: opacity 0.3s ease;
  padding: 0.8em;
  border-radius: 8px;
}

.scroll-down:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

/* home intro */
.home-intro {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
}

.home-intro-title {
  font-size: 2.75rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 1.25rem 0;
  letter-spacing: -0.02em;
}

.home-intro-title:not(:first-child) {
  margin-top: 3.5rem;
}

.home-intro-text {
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0 0 1.25rem 0;
  opacity: 0.92;
}

.home-intro-cta-line {
  margin-top: 2.5rem;
  margin-bottom: 1.75rem;
}

.home-intro-link {
  display: inline-block;
  text-decoration: none;
}

.home-intro-link .cta-button:hover {
  background-color: #b12727;
}

@media (max-width: 768px) {
  .home-intro {
    padding: 3rem 1.25rem 4rem;
  }
  .home-intro-title {
    font-size: 2.1rem;
  }
  .home-intro-title:not(:first-child) {
    margin-top: 2.5rem;
  }
  .home-intro-text {
    font-size: 1.35rem;
  }
}

/* sections */
.section {
  width: 100%;
  max-width: 1000px;
  margin: 3em auto 2em auto;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2em 2em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  /* nav */
  .centered-nav {
    padding: 1rem 1rem;
    gap: 1rem;
  }
  
  .nav-links {
    gap: 1.5rem;
  }
  
  .centered-nav a {
    font-size: 0.9rem;
  }
  
  .theme-toggle-nav {
    font-size: 1.1em;
    padding: 0.4em;
  }
  
  /* Hero section */
  .hero {
    min-height: 100vh;
    padding: 1em;
  }
  
  .hero h1 {
    font-size: 2.2em;
  }
  
  .hero p {
    font-size: 1.1em;
  }
  
  .hero-image {
    width: 80px;
  }
  
  /* Sections */
  .section {
    padding: 1.5em 1em;
    max-width: 95%;
    margin: 2em auto 1.5em auto;
  }

  .section h2 {
    font-size: 1.6em;
  }

  .section p,
  .section ul li {
    font-size: 1em;
  }
  
  /* Chat */
  .bubble {
    max-width: 85%;
    font-size: 0.9em;
    padding: 0.7em 0.9em;
  }
  
  .chat-input-row {
    gap: 0.6em;
  }
  
  .chat-input-row textarea {
    min-height: 44px;
  }
  
  #sendBtn {
    width: 44px;
    height: 44px;
    font-size: 1.1em;
  }
  
  /* Buttons */
  .cta-button,
  .secondary-button {
    padding: 0.8em 1.2em;
    font-size: 0.95em;
  }
  
  /* Modal */
  .modal {
    width: 95%;
    padding: 1.2em;
  }
  
  /* Footer */
  footer {
    padding: 1.5em 1em;
    font-size: 0.85em;
  }
  
  /* Goals section mobile */
  .goal-input-row {
    flex-direction: column;
    gap: 0.6rem;
  }
  
  .goal-input-row input {
    width: 100%;
  }
  
  .add-goal-btn {
    width: 100%;
    padding: 0.8em 1.2em;
  }
  
  .recurring-toggle {
    justify-content: center;
  }
  
  .goal-item {
    padding: 0.8rem;
  }
  
  .goal-text {
    font-size: 0.95em;
  }
  
  .goal-details {
    font-size: 0.8em;
  }
  
  .goal-left {
    align-items: flex-start;
  }
  
  .goal-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .goal-details-modal {
    width: 95%;
    max-width: 400px;
  }
  
  .modal-buttons {
    flex-direction: column;
  }
  
  .modal-buttons button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* Small mobile devices */
  .hero h1 {
    font-size: 1.8em;
  }
  
  .hero p {
    font-size: 1em;
  }
  
  .section h2 {
    font-size: 1.4em;
  }
  
  .bubble {
    max-width: 90%;
    font-size: 0.85em;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .centered-nav a {
    font-size: 0.85rem;
  }
}

.section h2 {
  font-size: 2em;
  margin-bottom: 0.5em;
}

.section p,
.section ul li {
  font-size: 1.1em;
  margin-bottom: 0.75em;
}

.section ul {
  list-style: none;
  padding: 0;
  margin: 0.75em 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
}

.section ul li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding-left: 0;
  position: relative;
}

.section ul li::before {
  content: "✓";
  color: var(--accent-color);
  position: static;
  font-weight: bold;
}




/* inputs */
input[type="text"],
textarea {
  border-radius: 6px;
  border: 1px solid #ccc;
  background: var(--input-bg);
  color: var(--text-color);
  padding: 0.6em;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}


/* chat */
#chat-section h2 {
  font-size: 1.2em;
  margin-bottom: 0.5em;
  color: #666;
  font-weight: 500;
}

:root.dark-mode #chat-section h2 {
  color: #999;
}

#chat {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  padding: 1em 0;
  min-height: 140px;
  max-height: 400px;
  overflow-y: auto;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 0.6em;
  width: 100%;
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.bubble {
  padding: 0.8em 1em;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 0.95em;
  max-width: 70%;
  word-wrap: break-word;
  text-align: left;
}

.message.user .bubble {
  background-color: var(--accent-color);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant .bubble {
  background-color: var(--chat-bg-1);
  color: var(--text-color);
  border-bottom-left-radius: 4px;
}

:root.dark-mode .message.assistant .bubble {
  background-color: var(--chat-bg-2);
}

/* chat timestamp */
.timestamp {
  font-size: 0.7em;
  opacity: 0.5;
  margin-top: 0.2em;
  color: var(--text-color);
}

.message.user .timestamp {
  color: rgba(255, 255, 255, 0.7);
}

/* milo dashboard */
.milo-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding: 3.5rem 1.5rem 0 1.5rem;
}

.milo-dashboard #goalSection,
.milo-dashboard #chat-section {
  min-width: 0;
  min-height: 0;
}

.milo-dashboard .section {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0;
  max-width: none;
}

@media (max-width: 900px) {
  .milo-dashboard {
    padding: 0 1.5rem;
  }
}

/* goals */
#goalSection {
  padding-top: 2em;
}

.goal-input-container {
  display: flex;
  flex-direction: column;
  gap: 0rem;
  margin: 0.2rem 0 0rem 0;
}

.goal-input-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.goal-input-row input {
  flex: 1;
  min-width: 0;
}

.add-goal-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.6em 1.2em;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.add-goal-btn:hover {
  background-color: #b12727;
}

.recurring-toggle {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0;
}

.recurring-label {
  font-size: 0.9em;
  color: var(--text-color);
  opacity: 0.8;
}

/* Switch/Toggle styling */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.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: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Empty state for goal list */
.goal-list-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-color);
  opacity: 0.7;
  font-size: 1rem;
}

.progress-summary {
  margin: 0.25em 0 0;
  font-size: 0.95em;
  opacity: 0.85;
}

/* Goal list styling */
.goal-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.goal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--input-bg);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

:root.dark-mode .goal-item {
  border-color: rgba(255, 255, 255, 0.1);
}

.goal-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

:root.dark-mode .goal-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.goal-left {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  flex: 1;
}

.goal-left .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  cursor: pointer;
  font-weight: normal;
  margin-top: 0.2rem;
  margin: 0;
  padding: 0;
}

.goal-left .checkbox-label input[type="checkbox"] {
  display: none; /* Hide the actual checkbox input */
}

.goal-left .checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--input-bg);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
  background: var(--card-bg);
  display: block;
}

.goal-left .checkbox-label:hover .checkmark {
  border-color: var(--accent-color);
}

.goal-left .checkbox-label input[type="checkbox"]:checked + .checkmark {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.goal-left .checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px;
  font-weight: bold;
}

:root.dark-mode .goal-left .checkmark {
  border-color: #555;
  background: var(--card-bg);
}

:root.dark-mode .goal-left .checkbox-label:hover .checkmark {
  border-color: var(--accent-color);
}

.goal-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  align-items: flex-start;
}

.goal-text {
  font-size: 1rem;
  color: var(--text-color);
  transition: text-decoration 0.3s ease;
  font-weight: 500;
  text-align: left;
}

.goal-details {
  font-size: 0.85rem;
  color: var(--text-color);
  opacity: 0.7;
  transition: text-decoration 0.3s ease;
  line-height: 1.3;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}

.goal-details-text {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.due-number {
  color: var(--accent-color);
  font-weight: 600;
}

.due-unit {
  color: var(--accent-color);
  font-weight: 600;
}



.delete-goal {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.1em;
  padding: 0.3rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.goal-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-goal {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.2em;
  padding: 0.3rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: bold;
}

.edit-goal:hover {
  color: var(--accent-color);
  background-color: rgba(212, 47, 47, 0.1);
}

.delete-goal:hover {
  color: #d42f2f;
  background-color: rgba(212, 47, 47, 0.1);
}

/* Date header styling */
.date-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

:root.dark-mode .date-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.current-date {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-color);
  margin: 0;
  text-align: center;
}

/* Goal header styling */
.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.1rem;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

:root.dark-mode .goal-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.goal-header h2 {
  margin: 0;
}

.streak-display {
  font-weight: 600;
  color: var(--accent-color);
  margin: 0;
  font-size: 1.1em;
}



.milo-feedback-container {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

:root.dark-mode .milo-feedback-container {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.milo-feedback {
  margin: 0;
  color: var(--text-color);
  font-size: 0.9rem;
  line-height: 1.3;
  opacity: 0.8;
}

/* Goal details modal styling */
.goal-details-modal {
  max-width: 500px;
  width: 90%;
}

.goal-details-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.95em;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.8em;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 1rem;
}

.form-group textarea {
  resize: none;
  min-height: 60px;
  max-height: 300px;
  overflow-y: auto;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* terms checkbox */
.terms-agreement {
  margin: 1rem 0;
}

.terms-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-color);
  transition: opacity 0.2s ease;
  width: 100%;
}

.terms-text {
  flex: 1;
  word-wrap: break-word;
  min-width: 0;
}

.terms-checkbox-label:hover {
  opacity: 0.8;
}

.terms-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
  margin: 0;
}

.terms-checkbox-custom {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 4px;
  background: var(--card-bg);
  flex-shrink: 0;
  margin-top: 0.1rem;
  transition: all 0.2s ease;
  display: block;
}

.terms-checkbox-label:hover .terms-checkbox-custom {
  border-color: var(--accent-color);
}

.terms-checkbox-label input[type="checkbox"]:checked + .terms-checkbox-custom {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.terms-checkbox-label input[type="checkbox"]:checked + .terms-checkbox-custom::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

.terms-text a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.terms-text a:hover {
  text-decoration: underline;
}

/* Dark mode adjustments */
:root.dark-mode .terms-checkbox-custom {
  border-color: #555;
  background: var(--card-bg);
}

:root.dark-mode .terms-checkbox-label:hover .terms-checkbox-custom {
  border-color: var(--accent-color);
}

/* Goal details modal checkbox styling */
.goal-details-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95em;
  color: var(--text-color);
  transition: opacity 0.2s ease;
  margin: 0;
  padding: 0;
}

.goal-details-form .checkbox-label:hover {
  opacity: 0.8;
}

.goal-details-form .checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
  margin: 0;
}

.goal-details-form .checkmark {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 4px;
  background: var(--card-bg);
  flex-shrink: 0;
  transition: all 0.2s ease;
  display: block;
}

.goal-details-form .checkbox-label:hover .checkmark {
  border-color: var(--accent-color);
}

.goal-details-form .checkbox-label input[type="checkbox"]:checked + .checkmark {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.goal-details-form .checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

:root.dark-mode .goal-details-form .checkmark {
  border-color: #555;
  background: var(--card-bg);
}

:root.dark-mode .goal-details-form .checkbox-label:hover .checkmark {
  border-color: var(--accent-color);
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.modal-buttons button {
  padding: 0.6em 1.2em;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

/* Goal error message styling */
.goal-error-message {
  color: #d42f2f;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: center;
  padding: 0.5rem;
  background-color: rgba(212, 47, 47, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(212, 47, 47, 0.2);
  animation: errorShake 0.5s ease-in-out;
}

:root.dark-mode .goal-error-message {
  background-color: rgba(212, 47, 47, 0.15);
  border-color: rgba(212, 47, 47, 0.3);
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.edit-button {
  background-color: var(--accent-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-button:hover {
  background-color: #b12727;
}

.edit-icon {
  font-size: 0.9em;
}

/* chat input */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.8em;
  margin-top: 1em;
}

.chat-input-row textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 120px;
}

#sendBtn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

#sendBtn:hover {
  background-color: #b12727;
}

#sendBtn::before {
  content: "↑";
}

/* footer */
footer {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  padding: 2em 1em;
  text-align: center;
  font-size: 0.9em;
  color: var(--text-color);
  width: 100%;
  max-width: 1350px;
  margin: 0 auto;
}

:root.dark-mode footer {
  background: rgba(18, 18, 18, 0.6);
}

.footer-line {
  height: 1px;
  width: 60%;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 0 auto 1.5em auto;
}

:root.dark-mode .footer-line {
  background-color: rgba(255, 255, 255, 0.2);
}

.author-link {
  color: #d42f2f;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.author-link:hover {
  color: #b02525;
  text-decoration: underline;
}

.footer-link {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.85;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.footer-link:hover {
  opacity: 1;
  color: var(--accent-color);
}




/* modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.visible {
  display: flex !important;
}

.modal {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 1.5em;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  opacity: 0.7;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.1);
}

:root.dark-mode .modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.modal-button-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.confirm-rename-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.confirm-rename-btn:hover {
  background-color: #b12727;
  transform: translateY(-1px);
}

.confirm-rename-btn:active {
  transform: translateY(0);
}

/* auth required modal */
.auth-required-modal {
  max-width: 450px;
  padding: 0;
  overflow: hidden;
}

.auth-required-content {
  padding: 2.5rem;
  text-align: center;
}

.auth-required-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.auth-required-content h2 {
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
  color: var(--text-color);
  font-weight: 600;
}

.auth-required-content p {
  font-size: 1.1rem;
  color: var(--text-color);
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.auth-required-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.auth-required-buttons .cta-button,
.auth-required-buttons .secondary-button {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  min-width: 120px;
}

.auth-required-footer {
  border-top: 1px solid var(--input-bg);
  padding-top: 1.5rem;
}

.auth-required-footer a {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  font-size: 0.95rem;
}

.auth-required-footer a:hover {
  opacity: 1;
  color: var(--accent-color);
}

/* Mobile responsive for auth required modal */
@media (max-width: 768px) {
  .auth-required-modal {
    width: 95%;
    max-width: 400px;
  }
  
  .auth-required-content {
    padding: 2rem 1.5rem;
  }
  
  .auth-required-logo {
    width: 60px;
    height: 60px;
  }
  
  .auth-required-content h2 {
    font-size: 1.5rem;
  }
  
  .auth-required-content p {
    font-size: 1rem;
  }
  
  .auth-required-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .auth-required-buttons .cta-button,
  .auth-required-buttons .secondary-button {
    width: 100%;
    max-width: 200px;
  }
}

.modal input {
  margin-top: 1em;
  border-radius: 6px;
  width: 100%;
  border: 1px solid #ccc;
  padding: 0.6em;
  background: var(--input-bg);
  color: var(--text-color);
}


/* misc */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent-color);
  width: 0%;
  z-index: 1100;
}

/* auth */
.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-top: 8rem;
}

.auth-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.auth-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.auth-header p {
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
}

.auth-form {
  margin-bottom: 1.5rem;
}

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

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--input-bg);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--card-bg);
}

.password-requirements {
  margin-top: 0.5rem;
}

.password-requirements small {
  color: var(--text-color);
  opacity: 0.6;
  font-size: 0.85rem;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.forgot-password {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.forgot-password:hover {
  text-decoration: underline;
}

.auth-button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}

.auth-button:not(.secondary) {
  background: var(--accent-color);
  color: white;
}

.auth-button:not(.secondary):hover {
  background: #b12727;
  transform: translateY(-1px);
}

.auth-button.secondary {
  background: transparent;
  border: 2px solid var(--input-bg);
  color: var(--text-color);
}

.auth-button.secondary:hover {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: white;
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.button-loading {
  display: none;
}

.auth-button.loading .button-text {
  display: none;
}

.auth-button.loading .button-loading {
  display: inline;
}

.error-message {
  background: #fee;
  color: #c53030;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
  border: 1px solid #fed7d7;
}

:root.dark-mode .error-message {
  background: #2d1b1b;
  color: #feb2b2;
  border-color: #4a1c1c;
}

.auth-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--input-bg);
}

.auth-divider span {
  background: var(--card-bg);
  padding: 0 1rem;
  color: var(--text-color);
  opacity: 0.6;
  font-size: 0.9rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-footer p {
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
}

.auth-footer a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.terms-link {
  color: var(--accent-color);
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

/* Mobile responsive for auth */
@media (max-width: 480px) {
  .auth-container {
    padding: 1rem;
    padding-top: 6rem;
  }
  
  .auth-card {
    padding: 2rem 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .auth-header h1 {
    font-size: 1.5rem;
  }
  
  .auth-logo {
    width: 60px;
    height: 60px;
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* legal */
.legal-container {
  padding: 2rem;
  padding-top: 8rem;
  max-width: 800px;
  margin: 0 auto;
}

.legal-content {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--input-bg);
}

.legal-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.legal-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.legal-header p {
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
}

.legal-section {
  margin-bottom: 2.5rem;
}

.legal-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  font-weight: 600;
}

.legal-section p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.legal-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-section li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
  color: var(--text-color);
}

.legal-section a {
  color: var(--accent-color);
  text-decoration: none;
}

.legal-section a:hover {
  text-decoration: underline;
}

.legal-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--input-bg);
}

.back-button {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.back-button:hover {
  background: #b12727;
  text-decoration: none;
}

/* Mobile responsive for legal pages */
@media (max-width: 768px) {
  .legal-container {
    padding: 1rem;
    padding-top: 6rem;
  }
  
  .legal-content {
    padding: 2rem 1.5rem;
  }
  
  .legal-header h1 {
    font-size: 2rem;
  }
  
  .legal-logo {
    width: 60px;
    height: 60px;
  }
  
  .legal-section h2 {
    font-size: 1.3rem;
  }
}

/* 404 */
.error-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-top: 8rem;
}

.error-content {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.error-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.error-content h1 {
  font-size: 4rem;
  margin: 0 0 0.5rem 0;
  color: var(--accent-color);
  font-weight: 700;
}

.error-content h2 {
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
  color: var(--text-color);
  font-weight: 600;
}

.error-content p {
  font-size: 1.1rem;
  color: var(--text-color);
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.error-actions .cta-button,
.error-actions .secondary-button {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
}

.error-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.error-links a {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  font-size: 0.9rem;
}

.error-links a:hover {
  opacity: 1;
  color: var(--accent-color);
}

/* Mobile responsive for 404 page */
@media (max-width: 768px) {
  .error-container {
    padding: 1rem;
    padding-top: 6rem;
  }
  
  .error-content {
    padding: 2rem 1.5rem;
  }
  
  .error-logo {
    width: 60px;
    height: 60px;
  }
  
  .error-content h1 {
    font-size: 3rem;
  }
  
  .error-content h2 {
    font-size: 1.5rem;
  }
  
  .error-content p {
    font-size: 1rem;
  }
  
  .error-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .error-actions .cta-button,
  .error-actions .secondary-button {
    width: 100%;
    max-width: 200px;
  }
  
  .error-links {
    gap: 1rem;
  }
}

/* milo page */
.milo-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.milo-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.milo-nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.milo-nav-left .nav-links {
  margin-left: 0;
}

.milo-nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
}

.milo-nav-link:hover {
  opacity: 0.8;
}

.milo-nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.milo-nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

/* Milo page header */
.milo-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  justify-content: center;
  align-self: center;
  width: auto;
}

.milo-header h1 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-color);
  font-weight: 600;
}

.rename-btn {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.rename-btn:hover {
  background: var(--accent-color);
  color: white;
}

/* Mobile responsive for milo page */
@media (max-width: 768px) {
  .milo-nav {
    padding: 1rem 1rem;
  }
  
  .milo-nav-logo {
    width: 32px;
    height: 32px;
  }
  
  .milo-nav-brand {
    font-size: 1.2rem;
  }
  
  .milo-header {
    padding: 0;
    margin: 0;
  }
  
  .milo-header h1 {
    font-size: 1rem;
  }
  
  .rename-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
}
