*,
*::before,
*::after {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  background: linear-gradient(to bottom, #0f3c1f, #1c5e2a);
  font-family: 'Segoe UI', sans-serif;
  color: white;
  overflow: auto;
}

.app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  min-height: 100vh;
}

/* Header stays at the top */
.app-header {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 2rem;
  margin-top: 1.5rem;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 2rem;
  max-width: 24rem;
  margin: 0 auto;
  width: 100%;
}

/* Centered "What's New" */
#whats-new {
  margin-top: auto;
  margin-bottom: auto;
  text-align: center;
  font-size: 1.25rem;
  opacity: 0.9;
}

form {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 12px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #1c1c1c;
  color: #ddd;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

input::placeholder {
  color: #888;
}

button[type="submit"],
button[type="button"] {
  width: 100%;
  padding: 12px;
  background-color: #3b8b5d;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button[type="submit"]:hover,
button[type="button"]:hover {
  background-color: #2f714c;
}

/* Styling for the Bottom Navbar (only when logged in) */
#navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background-color: rgba(15, 60, 31, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  z-index: 10;
  justify-content: center;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 24rem;
  padding: 0 1rem;
}

.navbar-item {
  flex: 1;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background: none;
  outline: none;
  cursor: pointer;
  padding: 0.5rem;
}

.navbar-item img {
  height: 28px;
  width: 50px;
  max-height: 100%;
  max-width: 100%;
  filter: brightness(0) invert(1); /* turns black into white */
}

/* Hover effect: soft green */
.navbar-item:hover {
  background-color: rgba(52, 199, 89, 0.1); /* gentle green tint */
  border-radius: 8px;
}

/* Active tab indicator */
.navbar-item.active {
  border-top: 3px solid #34c759;
}

a {
  text-decoration: none;
  height: 100%;
}

.error-msg {
  color: #ff4d4f;
  background: rgba(255, 77, 79, 0.15);
  border-left: 4px solid #ff4d4f;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
  margin-top: 0;
}

.success-msg {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
  border-left: 4px solid #2ecc71;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
  margin-top: 0;
}

#stop-btn {
  background-color: red;
}

.buttonsDiv {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-btn {
  width: 48px;
  height: 48px;
  background-color: #28a745;
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.check-btn:hover {
  background-color: #24963e;
}

.check-btn img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

.cancel-btn {
  height: 48px;
  padding: 0 20px;
  line-height: 48px; /* vertically center text */
  color: white;
  background-color: transparent;
  border: 1.5px solid #aaa;
  border-radius: 12px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cancel-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.date-range-selector {
  max-width: 24rem;
  margin: 2rem auto;
  padding: 1.5rem;
  border-radius: 16px;
  background-color: rgba(255, 255, 255, 0.05); /* glassy green feel */
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.05);
  color: white;
}

.date-range-selector h2 {
  text-align: center;
  margin-bottom: 1.2rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.date-inputs {
  display: grid;
  grid-template-columns: 1fr 2fr;
  row-gap: 1rem;
  column-gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.date-inputs label {
  text-align: right;
  padding-top: 0.25rem;
  font-weight: 500;
  color: #ddd;
}

.date-inputs input {
  padding: 0.5rem;
  border: none;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

#submit-range {
  display: block;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: black;
  background-color: #34c759; /* vibrant green */
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#submit-range:hover {
  background-color: #28a745;
}

#summary-container {
  max-width: 24rem;
  margin: 0 auto;
  color: white;
  padding-bottom: 2rem;
}

.spinner {
  margin: 0 auto 16px auto;
  border: 6px solid rgba(255, 255, 255, 0.1);
  border-top: 6px solid #34c759;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.pdf-button-container {
  text-align: center;
  margin-bottom: 20px;
}

#download-pdf {
  background-color: #34c759;
  color: black;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  box-shadow: 0 4px 6px rgba(0, 255, 0, 0.1);
  transition: background-color 0.2s ease;
}

#download-pdf:hover {
  background-color: #28a745;
}

#download-pdf i {
  margin-right: 8px;
}

.user-response p {
  cursor: pointer !important;
  margin: 0;
}

#past-week-docs p {
  cursor: not-allowed;
}

.login-box,
.register-box {
  background-color: rgba(20, 40, 30, 0.9);
  padding: 2rem;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  margin: 2rem auto;
  color: #eee;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.login-box h1,
.register-box h1 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
  color: #fff;
}

.signup-link,
.login-link {
  text-align: center;
  margin-top: 1rem;
  color: #ccc;
}

.signup-link a,
.login-link a {
  color: #7ed6a2;
  text-decoration: underline;
}

.signup-link a:hover,
.login-link a:hover {
  color: #9be3bc;
}

.record-btn {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: none; /* transparent to show app's background */
  border: 1.5px solid white; /* thin solid white inner ring */
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  margin: 2rem auto 3rem auto; /* bottom margin (3rem) pushes it above navbar */
}

#start-conversation-btn, #start-recording-btn {
  /* Two soft glow rings */
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.15),  /* first glow ring */
    0 0 0 12px rgba(255, 255, 255, 0.05); /* second glow ring */
}

#stop-recording-btn {
  /* Red glow rings */
  box-shadow:
    0 0 0 6px rgba(255, 0, 0, 0.15),  /* first red ring */
    0 0 0 12px rgba(255, 0, 0, 0.07); /* second red ring */
}

.record-btn:hover {
  transform: scale(1.05);
}

.record-btn img,
button[type="button"] img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1); /* makes black SVG white */
}

.logout-button {
  display: block;
  padding: 10px 20px;
  background-color: transparent;
  border: 1.5px solid #fff;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
  width: fit-content;
  height: auto;
  margin: 0 auto;
}

.logout-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #34c759;
  color: #34c759;
}

.spondi-text {
  color: white;
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
}

.user-bubble {
  background-color: #4c9b6e; /* soft leafy green */
  color: white;
  padding: 12px 12px;
  border-radius: 16px;
  max-width: 80%;
  margin: 0.5rem 0 0.5rem auto; /* aligns bubble to the right */
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
  text-align: left;
}

.dot-loader {
  text-align: center;
  display: block;
}

.dots::after {
  content: '';
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: '';      }
  25%  { content: '.';     }
  50%  { content: '..';    }
  75%  { content: '...';   }
  100% { content: '';      }
}

#chat-input-container {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  border: 0.1rem solid #ccc;
  border-radius: 1.5rem;
  padding: 0.75rem 1rem;
  background-color: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

.response-box {
  flex: 1;
  border: none;
  resize: none;
  font-size: 1rem;
  line-height: 1.5;
  padding-right: 3rem; /* space for the button */
  outline: none;
  background: transparent;
}

#send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #006400;
  color: white;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  padding: 0;
}

#send-button:hover {
  background-color: #008000;
}

.send-icon {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.feedback-message {
  text-align: center;
  margin-top: 2rem;
  font-size: 1.1rem;
  color: #ffffff; /* white text for contrast */
  opacity: 0.95;
}

.center-text {
  text-align: center;
}

.page-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
  width: 24rem;
}


.indicator {
  flex: 1;
  height: 4px; /* thickness of the line */
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.indicator.active {
  background-color: white;
}

button[type="button"] {
  display: inline-flex;            
  align-items: center;             /* vertically center text + icon */
  gap: 0.5em;                      /* spacing between text and arrow */
  padding: 0.25rem 0.5rem;   
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  width: fit-content;
}

.right-align {
  display: flex;
  width: 24rem;
  justify-content: flex-end;
}

h3 {
  margin-bottom: 0rem;
}

.page-indicators {
  margin-bottom: -0.75rem;
}

.welcome-img {
  margin: auto; 
  width: 80%; 
  height: auto;
}

#welcome-feedback-btn {
  background-color: #154823; 
  padding: 2rem; 
  border-radius: 2rem; 
  margin: auto;
}

#welcome-feedback-img {
  height: 4rem; 
  width: auto;
}