/* styles.css */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #f8f9fa; /* Light gray background */
}

/* Disable all animations globally, except for the submit button and its children */
*:not(.send-button):not(.send-button *):not(.spinner-border) {
  transition: none !important;
  animation: none !important;
  transform: none !important;
}

.table-container {
  max-width: 800px;
  margin: 20px auto;
  background: #f0f2f5;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 90vh;
  position: relative;
  top: 0;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  will-change: auto !important;
}

.table-header {
  position: relative;
  z-index: 1002;
  background: #8a2be2;
  color: white;
  padding: 15px 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

.chat-link {
  color: #ffffff !important;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-link:hover {
  opacity: 1;
}

.dropdown-container {
  padding: 10px 20px;
  background: #f8f9fa;
}

.form-content {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
}

/* Form elements */
.form-select,
.form-control {
  margin-bottom: 15px;
}

textarea {
  min-height: 100px;
  max-height: 200px;
  resize: vertical;
}

label {
  margin-bottom: 5px;
  display: block;
  font-weight: bold;
}

/* Table styles */
.table {
  margin-top: 20px;
  background: white;
  transition: none !important;
  transform: none !important;
}

.table th,
.table td {
  padding: 8px;
}

/* Submit button */
.btn-primary {
  margin-top: 10px;
  margin-bottom: 20px;
}

/* Spinner */
.spinner-border {
  display: none;
}

.submitting .spinner-border {
  display: inline-block;
}

/* Add these styles for latest response highlighting */
.latest-response {
  animation: highlightFade 2s ease-out;
  background-color: rgba(
    138,
    43,
    226,
    0.1
  ) !important; /* Light purple background */
}

@keyframes highlightFade {
  from {
    background-color: rgba(138, 43, 226, 0.2) !important;
  }
  to {
    background-color: rgba(138, 43, 226, 0.1) !important;
  }
}

/* Override Bootstrap's striped table for latest response */
.table-striped > tbody > tr.latest-response:nth-of-type(odd),
.table-striped > tbody > tr.latest-response:nth-of-type(even) {
  background-color: rgba(138, 43, 226, 0.1) !important;
}

/* Update dropdown spacing in styles.css */
.dropdown-container {
  padding: 10px 20px;
  background: #f8f9fa;
}

/* Remove any extra margin between dropdowns */
#subscriptionContainer {
  margin-top: -5px; /* Negative margin to reduce gap */
  border-top: 1px solid #eee; /* Optional: adds subtle separation */
}

/* Ensure consistent spacing for both dropdowns */
.form-select {
  margin-bottom: 0; /* Remove bottom margin from select elements */
}

/* Add these styles for the clear button */
.btn-danger {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-danger:hover {
  background-color: #c82333;
}

/* Add these styles to your existing CSS */
.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.clear-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.clear-button svg {
  transition: transform 0.2s ease-in-out;
}

.clear-button:hover svg {
  transform: rotate(-15deg);
}

/* Add/update these styles */
.api-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.api-header h2 {
  margin: 0;
}

.clear-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.clear-button svg {
  transition: transform 0.2s ease-in-out;
}

.clear-button:hover svg {
  transform: rotate(-15deg);
}

.login-container {
  background: white;
  padding: 48px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 400px; /* Fixed width for the white container */
  text-align: left; /* Align text to the left as shown in screenshot */
}

.login-container h1 {
  color: #202124; /* Dark gray color */
  font-size: 40px;
  margin: 0 0 8px 0;
  font-family: "Google Sans", arial, sans-serif;
  font-weight: 400;
}

.login-container p {
  color: #202124; /* Dark gray color */
  font-size: 24px;
  margin: 0 0 32px 0;
  font-family: "Google Sans", arial, sans-serif;
  font-weight: 400;
}

.signin-button {
  margin-top: 32px;
}

.g_id_signin {
  display: flex;
  justify-content: flex-start; /* Align button to the left */
}

.header-controls {
  display: flex;
  gap: 20px;
  align-items: center;
}

.logout-btn {
  color: #ffffff !important;
  opacity: 0.8;
  transition: opacity 0.2s;
  text-decoration: none;
}

.logout-btn:hover {
  opacity: 1;
}

/* Ensure table appears instantly, but allow animations on the submit button */
.table:not(.send-button):not(.send-button *),
.table *:not(.send-button):not(.send-button *):not(.spinner-border) {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  will-change: auto !important;
}

/* Submit Button Styles */
.send-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 40px;
}

.send-button .button-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button .spinner-border {
  display: none;
  width: 1.5rem;
  height: 1.5rem;
}

.send-button.submitting .spinner-border {
  display: inline-block;
}

.send-button.submitting .button-content {
  display: none;
}

.clear-history-btn {
  color: #ffffff !important;
  opacity: 0.8;
  transition: opacity 0.2s;
  cursor: pointer;
}

.clear-history-btn:hover {
  opacity: 1;
}

/* Prevent default link behavior */
.clear-history-btn {
  text-decoration: none;
}

/* Add hover effect */
.clear-history-btn svg {
  transition: transform 0.2s ease-in-out;
}

.clear-history-btn:hover svg {
  transform: rotate(-15deg);
}

/* Add to both styles.css and chat.css */
.menu-container {
  position: relative;
  z-index: 1002;
}

.menu-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.menu-dropdown {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  background: white !important;
  width: 280px !important;
  padding: 20px !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  z-index: 9999 !important; /* Very high z-index */
  display: none;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
}

.menu-dropdown.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* User section styles */
.user-section {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
}

.user-icon {
  width: 48px !important;
  height: 48px !important;
  background: #8a2be2 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 24px !important;
  color: white !important;
}

.user-details {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.user-name {
  color: #333 !important;
  font-size: 20px !important;
  font-weight: 500 !important;
}

.logout-link {
  color: #666 !important;
  text-decoration: none !important;
  font-size: 16px !important;
  opacity: 0.9 !important;
}

.logout-link:hover {
  opacity: 1 !important;
  color: #8a2be2 !important;
}

/* Remove the full-height menu and overlay */
.menu-overlay {
  display: none;
}

.inline-dropdowns {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  width: 100%;
}

.inline-dropdowns .dropdown-container {
  flex: 0 0 48%;
  min-width: 0;
}

.inline-dropdowns select {
  width: 100%;
  box-sizing: border-box;
}

.table td {
  white-space: pre-line; /* Preserve line breaks */
  vertical-align: top;
  padding: 12px 16px;
}

.table td strong {
  font-weight: 600;
}
