:root {
  --brand-primary: #000000;
  --brand-primary-hover: #ffffff;
  --brand-secondary: #10b981;
  --text-on-primary: #ffffff;
  --text-on-hover: #000000;
  --bg-page: #ffffff;
  --very-light-grey: #f7f7f7;
  --shadow-depth: 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 0.75rem;
  --spacing: 1rem;
  --font-sans: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg-page);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: #1f2937;
  margin: 0;
  padding: 4rem 2rem 2rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  box-sizing: border-box;
}

/* -------------------------------
   TOPBAR: Brand + About Us
--------------------------------- */
#topbar-bar {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  position: fixed;
  top: 1rem;
  left: 0;
  width: 100%;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  z-index: 999;
  background: var(--bg-page);
}


#brand {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-sans);
  color: #000;
}

#aboutBtn {
  margin-left: auto;
  background-color: white;
  color: black;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border: 1px solid black;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

#aboutBtn:hover {
  background-color: black;
  color: white;
}

/* -------------------------------
   LOGOUT BUTTON
--------------------------------- */
#logoutBtn {
  background-color: var(--brand-primary);
  color: var(--text-on-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#logoutBtn:hover {
  background-color: var(--brand-primary-hover);
  color: var(--text-on-hover);
  border: 1px solid #000;
}

/* -------------------------------
   MAIN CARD CONTAINERS
--------------------------------- */
#content,
#doneMessage {
  margin-top: 6rem;
  background: #f2f2f2;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  margin: 2rem auto 0;
  width: 90%;
  max-width: 1000px;
  box-sizing: border-box;
}

/* -------------------------------
   LANDING PAGE
--------------------------------- */
#landing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100vh;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}

#landing p {
  font-size: 1.5rem;
  line-height: 1.6;
  font-weight: 500;
}

/* -------------------------------
   SUMMARY + TEXTAREA STYLES
--------------------------------- */
#summaryBox,
#aiReplyEditable {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

#summaryBox {
  margin-bottom: 1.5rem;
  font-style: italic;
  overflow-wrap: break-word;
}

#aiReplyEditable {
  border: 1px solid #e5e7eb;
  font-size: 1rem;
  color: #111827;
  resize: vertical;
  line-height: 1.5;
}

/* -------------------------------
   BUTTONS
--------------------------------- */
button {
  background-color: var(--brand-primary);
  color: var(--text-on-primary);
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  cursor: pointer;
  margin: var(--spacing) 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

button:hover {
  background-color: var(--brand-primary-hover);
  color: var(--text-on-hover);
  border: 1px solid #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
  justify-content: flex-start;
}

/* -------------------------------
   TYPOGRAPHY
--------------------------------- */
h1 {
  font-size: 1.75rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.05rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

#doneMessage {
  text-align: center;
  font-size: 1.25rem;
  color: #4b5563;
  padding: 2rem;
}

/* -------------------------------
   AUDIO
--------------------------------- */
audio {
  width: 100%;
  margin: 1rem 0;
}

/* -------------------------------
   LOADING SCREEN
--------------------------------- */
.loading-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  font-family: var(--font-sans);
  height: 100vh;
}

.loading-screen p {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0.5rem 0;
}


/* 1. Allow absolutely positioned children */
#content {
  position: relative;
}

/* 2. Style the pause button */
#pauseBtn {
  position: absolute;
  top: 1rem;        /* distance from top of the card */
  right: 1rem;      /* distance from right edge */
  width: 2.5rem;
  height: 2.5rem;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem; /* size of the “||” */
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.1s ease;
}
#pauseBtn:hover {
  transform: scale(1.1);
}

.control-btn {
  background: #222;
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  cursor: pointer;
  transition: background 0.2s ease;
  align-items: center;
  display: inline-flex;
}

.control-btn.active {
  background: #fff;
  color: #222;
}

/* optional disabled look */
.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.control-btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
  flex-shrink: 0;
}


.control-btn:not(.loading) .spinner {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


#hamburger {
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-size: 1.5rem;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 240px;
  height: 100%;
  background-color: #f6f6f6;
  border-right: 1px solid #ccc;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  left: -100%; /* 👈 fully hidden */
  padding: 1rem;
  transition: left 0.3s ease-in-out;
  z-index: 999;
}

.sidebar.show {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#collapseBtn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: black; 
}

.sidebar-content ul {
  list-style: none;
  padding: 0;
}

.sidebar-content {
  overflow-y: auto;
  max-height: calc(100vh - 60px); /* minus header */
  padding-right: 0.5rem;
}


.sidebar-link {
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: #333;
}

.contact-entry {
  margin-bottom: 1rem;
}

.contact-entry input {
  width: 100%;
  padding: 0.4rem;
  font-size: 0.85rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.contact-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.contact-actions button {
  flex: 1;
  padding: 0.4rem;
  font-size: 0.8rem;
  border: none;
  border-radius: 5px;
  background-color: #000;
  color: white;
  cursor: pointer;
}


.sidebar-status {
  background-color: #d1e7dd;
  color: #0f5132;
  font-size: 0.8rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}


#contactsBtn {
  display: inline-block;
  padding: 8px 14px;
  margin: 8px 0;
  background-color: #f0f0f0;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.2s ease;
}

#contactsBtn:hover {
  background-color: #e2e2e2;
}

#logoutBtn {
  display: inline-block;
  padding: 8px 14px;
  margin: 8px 0;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.2s ease;
}

#logoutBtn:hover {
  background-color: #f1b0b7;
}


.toast-container {
  position: fixed;
  top: 5.5rem; /* ~1rem for topbar + 1.5rem spacing */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}



/* ✅ Shared style */
.toast {
  background-color: #1f2937;
  color: white;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-depth);
  opacity: 0.95;
}

/* 🎯 Temporary toast (use by showToast) */
.toast.temporary {
  animation: fadeIn 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
}

/* 🎯 Status toast (use by setStatus) */
.toast.status {
  background-color: #e8fbe9;
  color: #155724;
  border: 1px solid #c3e6cb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}



@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

.fade-in {
  animation: fade-in 0.2s ease;
}

.fade-out {
  animation: fade-out 0.2s ease;
}


#templatesBtn {
  display: inline-block;
  padding: 8px 14px;
  margin: 8px 0;
  background-color: #f0f0f0;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.2s ease;
}

#templatesBtn:hover {
  background-color: #e2e2e2;
}
