@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@500;600;700&display=swap");

:root {
  --primary-color: #2c5282;
  --primary-hover-color: #2a69ac;
  --secondary-color: #3182ce;
  --secondary-hover-color: #2b6cb0;
  --accent-color: #27b2cf;
  --success-color: #38a169;
  --error-color: #e53e3e;
  --text-color: #2d3748;
  --text-muted-color: #718096;
  --heading-color: #1a202c;
  --bg-color: #f7fafc;
  --sidebar-bg: #ffffff;
  --sidebar-text-color: var(--text-muted-color);
  --sidebar-active-bg: #edf2f7;
  --sidebar-active-text: var(--primary-color);
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --input-border-color: #e2e8f0;
  --input-focus-border: var(--accent-color);
  --light-border-color: #edf2f7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --font-primary: "Inter", sans-serif;
  --font-headings: "Montserrat", sans-serif;
  --border-radius-sm: 4px;
  --border-radius-md: 6px;
  --border-radius-lg: 10px;
  --sidebar-width: 250px;
  --top-bar-height: 60px;
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden; /* Prevent background scroll when modal is open */
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headings);
  color: var(--heading-color);
  margin-bottom: 0.75em;
  line-height: 1.3;
}
h1 {
  font-size: 1.8rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.25rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover-color);
  text-decoration: underline;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease-in-out;
}
.sidebar-header {
  padding: 20px 15px; /* Adjust padding for vertical layout */
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column; /* Stack items */
  align-items: center; /* Center horizontally */
  justify-content: center; /* Center vertically */
  height: auto; /* Allow height to grow */
  min-height: 100px; /* Give it some decent initial space */
  text-align: center; /* Center text for descendants */
  flex-shrink: 0;
}
.sidebar-logo {
  max-height: 42px; /* Can be a bit bigger */
  width: auto;
  margin: 0 0 12px 0; /* Remove side margin, add bottom margin */
}
.sidebar-app-name {
  font-family: var(--font-headings);
  font-size: 1.15rem; /* Slightly adjust size */
  font-weight: 600;
  color: var(--heading-color);
  white-space: normal; /* Allow title to wrap */
  line-height: 1.3; /* Improve readability of wrapped text */
}
.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
}
.sidebar-nav ul {
  list-style: none;
  padding: 15px 0;
}
.sidebar-nav li a.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-muted-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-left-color 0.2s ease;
  border-left: 4px solid transparent;
}

.sidebar-nav li a.nav-link svg {
  margin-right: 15px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-nav li a.nav-link:hover {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--primary-hover-color);
  text-decoration: none;
}
.sidebar-nav li a.nav-link.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 700;
  border-left-color: var(--primary-color);
}
.sidebar-nav li a.nav-link.active svg {
  color: var(--primary-color);
} /* Target SVG for color */

.sidebar-footer {
  margin-top: auto;
  padding: 15px;
  border-top: 1px solid var(--border-color);
  display: block; /* Changed from flex for stacking */
  flex-shrink: 0;
}
.user-profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* ADDED: Apply margin-bottom only in public mode */
.sidebar-footer.public-mode .user-profile-row {
  margin-bottom: 12px; /* Space between profile and credits */
}
.user-profile {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted-color);
  overflow: hidden; /* Important for long names */
  flex-grow: 1;
}
.user-profile svg {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
} /* Target SVG */
.user-profile span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Styling for the settings icon */
.settings-trigger {
  position: relative;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%; /* Make the hover background round */
  transition: background-color 0.2s ease;
  flex-shrink: 0; /* Prevent it from shrinking */
}
.settings-trigger:hover {
  background-color: var(--light-border-color);
}
.settings-trigger svg {
  color: var(--text-muted-color);
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease, color 0.2s ease; /* Animate transform and color */
}

/* The new, inline settings menu */
.sidebar-settings-menu {
  max-height: 0; /* Initially collapsed */
  overflow: hidden;
  transition: max-height 0.35s ease-out, margin-top 0.35s ease-out; /* Smooth animation */
  background-color: var(--sidebar-active-bg);
  margin-top: 0;
  border-radius: var(--border-radius-md);
}
.sidebar-settings-menu a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.sidebar-settings-menu a:hover {
  background-color: var(--border-color);
  color: var(--primary-color);
  text-decoration: none;
}

/* The "Expanded" state, triggered by JavaScript */
.sidebar-footer.settings-expanded .sidebar-settings-menu {
  max-height: 200px; /* Animate to this height. Adjust if you add more links. */
  margin-top: 12px; /* Add space between the user row and the menu */
}

/* Rotate the icon and change its color when expanded */
.sidebar-footer.settings-expanded .settings-trigger svg {
  transform: rotate(90deg);
  color: var(--primary-color);
}

/* --- End of MODIFIED styles --- */

.credits-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--light-border-color);
  border-radius: var(--border-radius-md);
}
.credits-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted-color);
}
.credits-footer .user-credits-text {
  font-weight: bold;
  color: var(--heading-color);
}
#userCreditsFooter {
  font-weight: bold;
  color: var(--primary-color);
}
#buyCreditsFooterButton {
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: bold;
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}
#buyCreditsFooterButton:hover {
  background-color: var(--secondary-hover-color);
  border-color: var(--secondary-hover-color);
}

/* Main Content */
.main-wrapper {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.top-bar {
  height: var(--top-bar-height);
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 25px;
  position: sticky;
  top: 0;
  z-index: 900;
  flex-shrink: 0;
}
.top-bar h1#currentViewTitle {
  font-size: 1.4rem;
  margin-bottom: 0;
  color: var(--heading-color);
  font-family: var(--font-headings);
}

/* Form Styling */
form div {
  margin-bottom: 15px;
}
form label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--text-color);
}
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="url"],
form select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--input-border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="url"]:focus,
form select:focus,
textarea:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 2px rgba(var(--accent-color), 0.3);
}
textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--font-primary);
}

input[type="submit"],
button,
.button-like-link {
  background-color: var(--primary-color);
  color: var(--card-bg);
  border: 1px solid var(--primary-color);
  padding: 10px 22px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
  text-align: center;
  display: inline-block;
  line-height: 1.5;
}
form input[type="submit"] {
  display: block;
  width: auto;
  margin-top: 10px;
}
button:hover,
form input[type="submit"]:hover,
.button-like-link:hover {
  background-color: var(--primary-hover-color);
  border-color: var(--primary-hover-color);
  text-decoration: none;
}

.mobile-nav-toggle {
  display: none;
  background-color: transparent !important;
  color: var(--heading-color) !important;
  border: none !important;
  padding: 5px;
  margin-right: 15px;
}
.mobile-nav-toggle:hover {
  background-color: var(--light-border-color) !important;
}
.mobile-nav-toggle svg {
  /* Target SVG */
  width: 24px;
  height: 24px;
}

.content-area {
  padding: 25px;
  flex-grow: 1;
}
.view {
  display: none;
}
.view.active-view {
  display: block;
  animation: fadeInContent 0.4s ease-out;
}
@keyframes fadeInContent {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stats Cards */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 20px 25px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.stat-card-icon {
  flex-shrink: 0;
  background-color: var(--light-border-color);
  color: var(--primary-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon svg {
  width: 24px;
  height: 24px;
}

.stat-card-info {
  display: flex;
  flex-direction: column;
}

.stat-card-number {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: var(--font-headings);
  color: var(--heading-color);
  line-height: 1.1;
}

.stat-card-label {
  font-size: 0.9rem;
  color: var(--text-muted-color);
  font-weight: 500;
}

.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 25px 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}
.card h2 {
  margin-top: 0;
}
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

/* Create Link Section */
.card-header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2em;
}
.card-header-with-action h2 {
  margin-bottom: 0;
}
.info-button {
  background: transparent;
  border: none;
  color: var(--text-muted-color);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  line-height: 0; /* for better icon alignment */
}
.info-button:hover,
.info-button:focus {
  background-color: var(--light-border-color);
  color: var(--primary-color);
  outline: none;
}
.info-button svg {
  width: 20px;
  height: 20px;
}

.generated-link-label {
  margin-top: 1.5em;
  font-weight: normal;
  font-size: 1rem;
  margin-bottom: 0.5em;
}
code#codeBlockUrl {
  display: block;
  background-color: var(--light-border-color);
  padding: 12px 18px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  margin-bottom: 10px;
  color: var(--text-color);
  min-height: 18px;
  max-height: fit-content;
  overflow-x: auto;
}
#copyUrlButton {
  margin-top: 5px;
  margin-bottom: 10px;
}
#kopieerLinkFout {
  color: var(--error-color) !important;
  font-size: 0.9rem;
  margin-top: 8px;
  text-align: left;
}

/* Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 25px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
}
th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
th {
  background-color: var(--light-border-color);
  font-weight: bold;
  font-family: var(--font-headings);
  color: var(--heading-color);
  font-size: 0.9rem;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover {
  background-color: var(--bg-color);
}

/* REMOVED OLD BUTTON STYLES */

/* Tabs in Create Link */
.tab {
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 25px;
}
.tab button.tablinks {
  background-color: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 12px 18px;
  transition: color 0.2s ease, border-bottom-color 0.2s ease,
    background-color 0.2s ease;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted-color);
  border-bottom: 3px solid transparent;
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
  margin-right: 5px;
  margin-bottom: -1px;
}
.tab button.tablinks:hover {
  color: var(--primary-color);
  background-color: var(--light-border-color);
}
.tab button.tablinks.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: bold;
  background-color: transparent;
}
.tabcontent {
  display: none;
  padding: 20px 5px;
  animation: fadeInContent 0.5s;
  border-top: none;
}
.tabcontent form div {
  margin-bottom: 12px;
}

/* Status Form Controls */
#status-form .status-form-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 25px;
}
#status-form .status-form-controls > div {
  flex-grow: 1;
  min-width: 200px;
}
#status-form .status-form-controls label {
  margin-bottom: 6px;
}
#status-form .status-form-controls input[type="text"],
#status-form .status-form-controls select {
  margin-bottom: 0;
}

/* Pagination */
#pagination1,
#pagination2 {
  display: flex;
  justify-content: center;
  margin-top: 25px;
  gap: 8px;
}
#pagination1 button,
#pagination2 button {
  padding: 8px 12px;
  font-size: 0.9rem;
  background-color: var(--card-bg);
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  transition: background-color 0.2s ease, color 0.2s ease;
  border-radius: var(--border-radius-sm);
  margin: 0;
}
#pagination1 button:hover,
#pagination2 button:hover {
  background-color: var(--light-border-color);
}
#pagination1 button.active,
#pagination2 button.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Recent Tests Section */
#recent-filled-tests-section h3 {
  font-size: 1.15rem;
  color: var(--heading-color);
  margin-bottom: 15px;
}
#recentTestsTable {
  margin-bottom: 0;
}
#recentTestsTable th {
  font-size: 0.9rem;
}
#recentTestsTable td {
  font-size: 0.85rem;
  vertical-align: middle;
}
#noRecentTestsMessage {
  padding: 12px;
  text-align: center;
  background-color: var(--light-border-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-muted-color);
  font-size: 0.9rem;
  margin-top: 15px;
}
#recentTestsTable .time-ago {
  font-size: 0.8em;
  color: var(--text-muted-color);
  display: block;
  margin-top: 2px;
}

/* Table Column Alignment */
#testStatusTable1 tr th:nth-child(5), /* 5th column is Actions */
#testStatusTable1 tr td:nth-child(5),
#testStatusTable2 tr th:last-child,
#testStatusTable2 tr td:last-child,
#recentTestsTable tr th:last-child,
#recentTestsTable tr td:last-child {
  text-align: center;
}

/* App Footer */
.app-footer {
  text-align: center;
  padding: 15px;
  font-size: 0.85rem;
  color: var(--bg-color);
  background-color: var(--heading-color);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  flex-shrink: 0;
}
.app-footer a {
  color: var(--accent-color);
}
.app-footer a:hover {
  text-decoration: underline;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1050;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.3s ease;
  padding: 20px;
}
.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.modal-container {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 1024px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(1);
  transition: transform 0.3s ease;
}
.modal-container.modal-sm {
  max-width: 550px;
  max-height: 80vh;
}
.modal-overlay.hidden .modal-container {
  transform: scale(0.95);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 50px 15px 25px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  position: relative;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--heading-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.close-modal-btn {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  padding: 0 5px;
  cursor: pointer;
  color: var(--text-muted-color);
  transition: color 0.2s ease, transform 0.2s ease;
}
.close-modal-btn:hover {
  background-color: transparent;
  color: var(--heading-color);
  transform: translateY(-50%) scale(1.1);
}
.modal-body {
  padding: 25px;
  overflow-y: auto;
  flex-grow: 1;
}
#infoModal .modal-body p {
  font-size: 1rem;
  line-height: 1.6;
}
.modal-body #downloadDiv,
.modal-body #downloadPdfDiv {
  display: block;
}
.modal-body #downloadPdfDiv {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
}
.modal-body fieldset {
  border: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}
.modal-body #antwoordenDiv,
.modal-body #berekeningenDiv {
  display: block;
}
.modal-content-wrapper {
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}
.modal-content-wrapper.hidden {
  opacity: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .top-bar h1#currentViewTitle {
    font-size: 1.2rem;
    margin-left: auto;
    margin-right: auto;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  #status-form .status-form-controls {
    flex-direction: column;
    align-items: stretch;
  }
  #status-form .status-form-controls > div {
    min-width: 0;
    margin-bottom: 15px;
  }
  #status-form .status-form-controls > div:last-child {
    margin-bottom: 0;
  }
  .tab button.tablinks {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .content-area {
    padding: 15px;
  }
  .card {
    padding: 20px;
  }
}

/* Print Styles */
@media print {
  body.modal-open,
  body {
    overflow: visible !important;
    background: #fff !important;
    padding: 1cm !important;
    margin: 0 !important;
  }
  body > *:not(#answersModal) {
    display: none !important;
  }
  #answersModal,
  .modal-container {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .modal-header,
  #downloadPdfDiv {
    display: none !important;
  }
  .modal-body,
  .modal-body #downloadDiv,
  .modal-body #modalContentWrapper {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    display: block !important;
  }
  #antwoordenFieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }
  table,
  p,
  li {
    page-break-inside: avoid;
  }
}

button:not(.mobile-nav-toggle):not(.close-modal-btn),
input[type="submit"],
input[type="button"],
.button-like-link {
  padding: 0.5rem 1rem; /* Reduced from a likely larger value. Adjust as needed. */
  font-size: 0.9rem; /* Slightly smaller font. Adjust as needed. */
  height: auto; /* Ensure height is determined by padding and font-size */
  line-height: 1.5; /* Improves vertical alignment of text */
}

.generated-link-container {
  display: flex;
  align-items: center;
  background-color: var(--light-border-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  margin-bottom: 10px;
}
.generated-link-container code#codeBlockUrl {
  flex-grow: 1;
  border: none;
  background: none;
  margin-bottom: 0;
}
.generated-link-container button#copyUrlButton {
  flex-shrink: 0;
  margin: 4px;
  padding: 6px;
  background-color: transparent;
  border: none;
  color: var(--text-muted-color);
}
.generated-link-container button#copyUrlButton:hover {
  background-color: var(--border-color);
  color: var(--primary-color);
}

/* Action buttons in tables */
.actions-cell {
  text-align: center;
  white-space: nowrap; /* Prevent buttons from wrapping */
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted-color);
  line-height: 0;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
  margin: 0 3px;
}

.action-btn:hover {
  background-color: var(--light-border-color);
  color: var(--primary-color);
}

.action-btn.delete-active-test-btn:hover {
  color: var(--error-color);
  background-color: rgba(229, 62, 62, 0.1);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* Delete modal button hovers */
#confirmDeleteBtn:hover {
  background-color: #c53030 !important;
  border-color: #c53030 !important;
}

.action-btn.show-answers-button:hover {
  color: var(--secondary-color);
  background-color: rgba(49, 130, 206, 0.1);
}

.loader {
  border: 4px solid #f3f3f3; /* Light grey */
  border-top: 4px solid var(--primary-color); /* Your primary color */
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin: 20px auto; /* Center it */
}

.stat-card-loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

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