/* Right Side Layover */
.layover {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100%;
  background-color: #fff;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.layover.visible {
  transform: translateX(0);
}

.layover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.layover-title {
  margin: 0;
  font-size: 1.25rem;
}

.layover-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.layover-content {
  padding: 1rem;
  overflow-y: auto;
  flex-grow: 1;
}

.layover-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  z-index: 999;
}

.layover-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Layover Content --- */
.layover-user-info {
  display: flex;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 1rem;
}

.layover-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
}

.layover-username {
  font-weight: 500;
}

.layover-form {
  display: flex;
  flex-direction: column;
}

.layover-textarea {
  min-height: 120px; /* Sets a more reasonable default height */
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical; /* Allows the user to resize it vertically */
  font-family: var(--font-family-sans);
  margin-bottom: 1rem;
}

.layover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cancel-button {
  background-color: #f1f3f4;
  color: #5f6368;
  border: 1px solid #dadce0;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--button-border-radius);
  cursor: pointer;
  transition: background-color 0.2s;
}

.cancel-button:hover {
  background-color: #e8eaed;
}

/* --- Layover Messages --- */
.layover-message {
  display: none; /* Hidden by default */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 20px;
}

.layover-message .material-icons {
  font-size: 48px;
  margin-bottom: 16px;
}

.layover-success-message .material-icons {
  color: #2e7d32; /* Green */
}

.layover-error-message .material-icons {
  color: #c62828; /* Red */
}

/* --- Button Spinner --- */
.submit-button .button-spinner {
  display: none; /* Hidden by default */
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.submit-button:disabled {
  cursor: not-allowed;
}

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

/* --- Responses List --- */
.layover-response-count {
  font-weight: 500;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
  text-align: center;
}

.layover-responses-list {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 5px; /* For scrollbar */
  margin-bottom: 15px;
}

.response-item {
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.response-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.response-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
}

.response-username {
  font-weight: 500;
  margin-right: 8px;
}

.response-timestamp {
  font-size: 0.8em;
  color: #888;
}

.response-text {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.4;
}

/* --- Responses Status (Loading/Error) --- */
.layover-responses-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100px; /* Or adjust as needed */
  color: #5f6368;
}

.layover-responses-status .material-icons {
  font-size: 36px;
  margin-bottom: 10px;
  animation: spin 2s linear infinite; /* For loading spinner */
}

.layover-responses-status .layover-status-text {
  font-size: 1.1em;
}

/* --- Reply Specific Styles (Nested under Response) --- */
.replies-list {
  margin-top: 10px;
  padding-left: 20px; /* Indent replies */
  border-left: 2px solid #f0f0f0; /* Visual line for nesting */
}

.reply-item {
  background-color: #eef5f9; /* Lighter background for replies */
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  position: relative; /* For potential future positioning */
}

.reply-item:last-child {
  margin-bottom: 0; /* No margin for the last reply in a list */
}

.reply-header {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.reply-avatar {
  width: 24px; /* Smaller avatar for replies */
  height: 24px;
  border-radius: 50%;
  margin-right: 6px;
}

.reply-username {
  font-weight: 500;
  font-size: 0.9em;
  margin-right: 6px;
  color: #3c4043;
}

.reply-timestamp {
  font-size: 0.7em;
  color: #888;
}

.reply-text {
  margin: 0;
  font-size: 0.85em;
  line-height: 1.4;
}

/* Style for the reply form container */
.reply-form-container {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.reply-textarea {
  width: calc(100% - 20px); /* Adjust for padding */
  min-height: 80px; /* Smaller default height for reply textarea */
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  font-family: var(--font-family-sans);
  margin-bottom: 10px;
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
