/*==============================
  VARIABLES
==============================*/
:root {
  --bg-color: #fafafa;
  --text-color: #2c2c2c;
  --nav-bg-color: #f5f5f5;
  --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 STYLES
==============================*/
html, body {
  margin: 0;
  padding: 0;
  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; /* Account for sticky header */
}

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

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

/* Mobile touch improvements */
@media (max-width: 768px) {
  button, input, textarea {
    -webkit-tap-highlight-color: transparent;
  }
  
  button:active {
    transform: scale(0.98);
  }
  
  input, textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}


/*==============================
  NAVIGATION
==============================*/
.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.2rem;
}



.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);
}

.theme-toggle-nav {
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  font-size: 1.2em;
  padding: 0.5em;
  border-radius: 6px;
  transition: opacity 0.3s ease;
  align-self: center;
}

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

.person-nav {
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  font-size: 1.2em;
  padding: 0.5em;
  border-radius: 6px;
  transition: opacity 0.3s ease;
  position: relative;
}

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

.person-dropdown {
  position: absolute;
  top: 80%;
  right: -100;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  z-index: 9999;
  display: none;
  overflow: hidden;
  margin-top: 0.5rem;
}

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

.person-dropdown a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.3s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
}

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

.person-dropdown .divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 0.5rem 0;
}


/*==============================
  HERO SECTION
==============================*/
.hero {
  height: 80vh;
  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 {
  position: absolute;
  bottom: 4em;
  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); }
}


/*==============================
  SECTIONS & CONTAINERS
==============================*/
.section {
  width: 100%;
  max-width: 1000px;
  margin: 3em auto 0 auto;
  background: var(--card-bg);
  border-radius: 12px;
  padding: .5em 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) {
  /* Navigation */
  .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 {
    height: 80vh;
    padding: 1em;
  }
  
  .hero h1 {
    font-size: 2.2em;
  }
  
  .hero p {
    font-size: 1.1em;
  }
  
  .hero-image {
    width: 80px;
  }
  
  /* Sections */
  .section {
    padding: 2em 1em;
    max-width: 95%;
    margin: 2em auto 0 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; /* Better touch target */
  }
  
  #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: 1.5em;
}

.section ul {
  list-style: none;
  padding: 0;
  margin: 1.5em 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;
  margin-bottom: 0;
  padding-left: 0;
  position: relative;
}

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




/*==============================
  INPUTS & FORMS
==============================*/
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;
  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);
}

/*==============================
  GOALS SECTION
==============================*/
#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);
}

/* 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 AGREEMENT 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%;  /* Add this */
}

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

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

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

.terms-checkbox-custom {
  position: relative;
  width: 20px;   /* Slightly smaller for better proportion */
  height: 20px;  /* Slightly smaller for better proportion */
  border: 2px solid #ccc;  /* More visible border color */
  border-radius: 4px;
  background: var(--card-bg);
  flex-shrink: 0;
  margin-top: 0.1rem;  /* Adjusted margin */
  transition: all 0.2s ease;
  display: block;  /* Ensures proper block display */
}

.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 {
  flex: 1;
  word-wrap: break-word;
}

.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 {
  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;
}




/*==============================
  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);
}

/*==============================
  AUTHENTICATION 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;
}

/*==============================
  AUTHENTICATION STYLES
==============================*/
.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-top: 8rem; /* Add more padding to account for the fixed header */
}

.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 PAGES STYLES
==============================*/
.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 PAGE STYLES
==============================*/
.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 SPECIFIC STYLES
==============================*/
.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: 0.8rem;
}

.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;
  }
}
