/* Shared Dropdown Menu Base Styles */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: #ffffff;
  border: 1px solid #e4ebe4;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-opacity);
  z-index: var(--z-dropdown);
  overflow: hidden;
}

.dropdown-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Shared Menu Item Base Styles */
.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #001e00;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.menu-item:hover {
  background-color: #f2f7f2;
  color: #14a800;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 12px;
  background-color: #f9fbf9;
  border: 1px solid #e4ebe4;
  border-radius: 10px;
}

/* Desktop Header Controls Container */
.desktop-header-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* User Avatar Dropdown */
.user-avatar-dropdown {
  position: relative;
  display: inline-block;
}

/* Upwork-style Green Active Indicator Dot */
.user-avatar-dropdown::after {
  content: "";
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 9px;
  height: 9px;
  background-color: #14a800;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  z-index: 2;
}

.user-avatar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: #ffffff;
  border: 1px solid #e4ebe4;
  border-radius: 50%;
  color: #001e00;
  cursor: pointer;
  transition: var(--transition-normal);
}

.user-avatar-toggle:hover {
  background-color: #f2f7f2;
  border-color: #14a800;
  transform: translateY(-1px);
}

.user-avatar-toggle[aria-expanded="true"] {
  background-color: #f2f7f2;
  border-color: #14a800;
  box-shadow: 0 0 8px rgba(20, 168, 0, 0.1);
}

.user-avatar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: #001e00;
}

/* SVG Path contrast lock to make header icons absolutely visible on white headers */
.user-avatar-icon path,
.user-avatar-icon circle,
.language-dropdown-arrow path,
.user-avatar-menu-item svg path,
.mobile-admin-button svg path,
.mobile-logout-button svg path {
  stroke: #001e00 !important;
}

.user-avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-opacity);
  z-index: var(--z-dropdown);
  overflow: hidden;
  border: 1px solid #e4ebe4;
}

.user-avatar-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-avatar-menu-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e4ebe4;
  background: #f9fbf9;
}

.user-avatar-username {
  display: block;
  font-size: var(--font-sm);
  font-weight: 600;
  color: #001e00;
  word-break: break-word;
}

.user-avatar-menu-divider {
  height: 1px;
  background-color: #e4ebe4;
  margin: 0;
}

.user-avatar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #001e00;
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.user-avatar-menu-item:hover {
  background-color: #f2f7f2;
  color: #14a800;
}

.user-avatar-menu-item#desktop-logout-button:hover {
  background-color: var(--logout-red-alpha-10);
  color: var(--logout-red);
}

.user-avatar-menu-item:active {
  opacity: 0.8;
}

.user-avatar-menu-item svg {
  flex-shrink: 0;
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.user-avatar-menu-item span {
  flex: 1;
}

/* Hide Language Selector elements */
.language-dropdown,
.mobile-language-section {
  display: none !important;
}

.language-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background-color: #ffffff;
  border: 1px solid #e4ebe4;
  border-radius: 10px;
  color: #001e00;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  white-space: nowrap;
}

.language-dropdown-toggle:hover {
  background-color: #f2f7f2;
  border-color: #14a800;
  transform: translateY(-1px);
}

.language-dropdown-toggle[aria-expanded="true"] {
  background-color: #f2f7f2;
  border-color: #14a800;
}

.language-dropdown-toggle[aria-expanded="true"] .language-dropdown-arrow {
  transform: rotate(180deg);
}

.language-dropdown-toggle img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.language-dropdown-current {
  font-size: var(--font-sm);
  font-weight: 600;
  min-width: 24px;
  letter-spacing: 0.05em;
}

.language-dropdown-arrow {
  transition: var(--transition-transform);
  flex-shrink: 0;
  color: #001e00;
}

.language-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-opacity);
  z-index: var(--z-dropdown);
  overflow: hidden;
  border: 1px solid #e4ebe4;
}

.language-dropdown-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #001e00;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: var(--transition-bg);
  text-align: left;
  gap: var(--spacing-sm);
}

.language-dropdown-item:hover {
  background-color: #f2f7f2;
  color: #14a800;
}

.language-dropdown-item.active {
  background-color: rgba(20, 168, 0, 0.08);
  color: #14a800;
  font-weight: 600;
}

.language-dropdown-item.active::after {
  content: '✓';
  color: #14a800;
  font-weight: bold;
  font-size: var(--font-sm);
}

.language-dropdown-item span:first-child {
  font-weight: 700;
  min-width: 24px;
  font-family: var(--font-heading);
}

.language-dropdown-label {
  color: #475569;
  font-size: var(--font-xs);
  flex: 1;
  text-align: right;
}

.language-dropdown-item.active .language-dropdown-label {
  color: #14a800;
}

/* Darslar Mode Toggle - Segmented Pill Control */
.darslar-mode-toggle {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 36px;
  background-color: #f4f7f4;
  border: 1px solid #e4ebe4;
  border-radius: 20px;
  padding: 2px;
  z-index: 1000; /* Float above the sticky header (z-index: 990) */
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.darslar-mode-toggle .mode-tab {
  flex: 1;
  height: 30px;
  border: none;
  background: transparent;
  color: #001e00; /* Inactive Charcoal */
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 18px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  padding: 0;
  margin: 0;
  opacity: 0.6;
}

.darslar-mode-toggle .mode-tab.active {
  background-color: #14a800; /* Upwork Green active capsule background */
  color: #ffffff !important; /* Active White text color */
  box-shadow: 0 2px 8px rgba(20, 168, 0, 0.2);
  opacity: 1;
}

.darslar-mode-toggle .mode-tab:not(.active):hover {
  opacity: 0.95;
  color: #001e00 !important;
}

/* Lesson Mode Correct Answer Indicator */
.answer.lesson-mode-correct {
  border: 1px solid #14a800 !important;
  background-color: rgba(20, 168, 0, 0.08) !important;
  color: #001e00 !important;
  position: relative;
}

.answer.lesson-mode-correct::after {
  content: "✓";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #14a800;
  font-size: 1.25rem;
  font-weight: bold;
}

.answer.lesson-mode-correct .option-label {
  background: #14a800 !important;
  border-color: #14a800 !important;
  color: #ffffff !important;
}

/* Admin Dashboard */
.admin-dashboard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 30, 0, 0.25);
  backdrop-filter: blur(4px);
  z-index: var(--z-admin-overlay);
}

.admin-dashboard-overlay[data-standalone="true"] {
  display: none;
}

.admin-dashboard {
  position: fixed;
  inset: 50%;
  transform: translate(-50%, -50%);
  width: min(58.75rem, 92vw);
  max-height: min(90vh, 52.5rem);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e4ebe4;
  box-shadow: var(--shadow-lg);
  color: #001e00;
  z-index: var(--z-admin-panel);
  overflow: hidden;
}

.admin-dashboard[data-standalone="true"] {
  position: relative;
  inset: auto;
  transform: none;
  width: min(64rem, 94vw);
  max-height: none;
  margin: var(--spacing-xl) auto var(--spacing-2xl);
  background: #ffffff;
}

.admin-dashboard[data-standalone="true"] .admin-dashboard__header {
  justify-content: flex-start;
}

.admin-dashboard__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-lg);
  padding: var(--spacing-xl);
  border-bottom: 1px solid #e4ebe4;
}

.admin-dashboard__subtitle {
  margin-top: 6px;
  color: #475569;
  font-size: var(--font-sm);
}

.admin-dashboard__close {
  background: #ffffff;
  border: 1px solid #e4ebe4;
  border-radius: 50%;
  color: #001e00;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-normal);
}

.admin-dashboard__close:hover {
  background: #f2f7f2;
  border-color: #14a800;
  color: #14a800;
  transform: scale(1.05);
}

.admin-dashboard__body {
  padding: var(--spacing-xl);
  display: grid;
  gap: var(--spacing-xl);
  overflow-y: auto;
}

.admin-dashboard[data-standalone="true"] .admin-dashboard__body {
  overflow: visible;
  max-height: none;
}

.admin-section {
  background: #f9fbf9;
  border-radius: 12px;
  border: 1px solid #e4ebe4;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.admin-section__description {
  color: #475569;
  font-size: var(--font-sm);
  line-height: 1.5;
}

.admin-token-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
}

.admin-token-form input {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e4ebe4;
  background: #ffffff;
  color: #001e00;
  font-size: var(--font-sm);
  transition: all 0.3s ease;
}

.admin-token-form input:focus {
  outline: none;
  border-color: #14a800;
  box-shadow: 0 0 0 3px rgba(20, 168, 0, 0.1);
}

.admin-token-form button,
.admin-primary-button,
.admin-button--secondary,
.admin-button--ghost {
  border-radius: 8px;
  border: none;
  padding: 12px 20px;
  font-family: var(--font-family);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  font-size: var(--font-sm);
}

#admin-logout-button {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

#admin-logout-button:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  transform: translateY(-1px);
}

.admin-token-form button,
.admin-primary-button {
  background: #14a800;
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(20, 168, 0, 0.15);
}

.admin-token-form button:hover,
.admin-primary-button:hover {
  background: #118f00;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20, 168, 0, 0.25);
}

.admin-button--secondary {
  background: #ffffff;
  color: #001e00;
  border: 1px solid #e4ebe4;
}

.admin-button--secondary:hover {
  background: #f2f7f2;
  border-color: #14a800;
  transform: translateY(-1px);
}

.admin-button--ghost {
  background: transparent;
  color: #001e00;
  border: 1px solid #e4ebe4;
}

.admin-button--ghost:hover {
  background: #f2f7f2;
  color: #14a800;
  border-color: #14a800;
  transform: translateY(-1px);
}

.admin-token-hint {
  font-size: var(--font-xs);
  color: #475569;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.admin-field label {
  color: #001e00;
  font-size: var(--font-sm);
  font-weight: 600;
}

.admin-field input {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e4ebe4;
  background: #ffffff;
  color: #001e00;
  font-size: var(--font-sm);
  transition: all 0.3s ease;
}

.admin-field input:focus {
  outline: none;
  border-color: #14a800;
  box-shadow: 0 0 0 3px rgba(20, 168, 0, 0.1);
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: #001e00;
  font-size: var(--font-sm);
  cursor: pointer;
  width: fit-content;
}

.admin-checkbox input {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: #14a800;
}

.admin-users-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
}

.admin-status {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: var(--font-sm);
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.admin-status--neutral {
  background: transparent;
  color: #475569;
}

.admin-status--info {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.admin-status--success {
  background: rgba(20, 168, 0, 0.08);
  color: #14a800;
  border: 1px solid rgba(20, 168, 0, 0.15);
}

.admin-status--warning {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.admin-status--error {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.admin-users-table-wrapper {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid #e4ebe4;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
}

.admin-users-table th,
.admin-users-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #e4ebe4;
  font-size: var(--font-sm);
  text-align: left;
}

.admin-users-table th {
  background: #f9fbf9;
  color: #001e00;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-users-table tr:hover td {
  background: #f2f7f2;
}

.admin-user-primary {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.admin-user-name {
  font-weight: 600;
}

.admin-user-role {
  font-size: var(--font-xs);
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #e4ebe4;
  color: #001e00;
  font-weight: 600;
  font-family: var(--font-heading);
}

.admin-user-role.admin-role {
  background: rgba(20, 168, 0, 0.08);
  color: #14a800;
  border: 1px solid rgba(20, 168, 0, 0.2);
}

.admin-user-role.student-role {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.admin-user-action {
  border-radius: 6px;
  border: 1px solid #e4ebe4;
  background: transparent;
  color: #001e00;
  padding: 6px 12px;
  font-size: var(--font-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-user-action:hover {
  background: #f2f7f2;
  border-color: #14a800;
  color: #14a800;
}

.admin-user-action.danger {
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.admin-user-action.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
  color: #ef4444;
}

.admin-empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  border-radius: 10px;
  border: 1px solid #e4ebe4;
  color: #475569;
  background: #f9fbf9;
}

.mobile-admin-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: #ffffff;
  border: 1px solid #e4ebe4;
  color: #001e00;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 8px;
  width: 100%;
  margin-bottom: var(--spacing-sm);
  cursor: pointer;
  transition: var(--transition-normal);
}

.mobile-admin-button:hover {
  background: #f2f7f2;
  border-color: #14a800;
}

.mobile-admin-button svg {
  flex-shrink: 0;
}

.admin-page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg) var(--spacing-xl);
  background: #ffffff;
  border-bottom: 1px solid #e4ebe4;
  color: #001e00;
}

.admin-page-user {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.admin-page-user-name {
  font-size: var(--font-lg);
  font-weight: 600;
}

.admin-page-user-meta {
  color: #475569;
  font-size: var(--font-sm);
}

.admin-page-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.admin-page-status {
  color: #475569;
  font-size: var(--font-sm);
}

.admin-credentials-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  background: rgba(0, 30, 0, 0.25);
  backdrop-filter: blur(4px);
  z-index: var(--z-admin-modal);
}

.admin-credentials-modal__content {
  position: relative;
  width: min(30rem, 92vw);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e4ebe4;
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  color: #001e00;
}

.admin-credentials-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
}

.admin-credentials-modal__subtitle {
  color: #475569;
  font-size: var(--font-sm);
  margin-top: -var(--spacing-sm);
}

.admin-credentials-fields {
  display: grid;
  gap: var(--spacing-sm);
}

.admin-credentials-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: 12px 16px;
  background: #f9fbf9;
  border-radius: 8px;
  border: 1px solid #e4ebe4;
}

.admin-credentials-label {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  font-weight: 600;
}

.admin-credentials-value {
  font-family: var(--font-heading);
  font-size: var(--font-md);
  color: #001e00;
  word-break: break-all;
}

.admin-credentials-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(20, 168, 0, 0.08);
  color: #14a800;
  font-size: var(--font-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid rgba(20, 168, 0, 0.15);
  font-family: var(--font-heading);
}

.admin-credentials-tag.student {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.admin-credentials-actions {
  display: flex;
  justify-content: center;
}

.admin-credentials-actions .admin-primary-button {
  width: 100%;
  justify-content: center;
}

.admin-credentials-status {
  min-height: 2.5rem;
  text-align: center;
}

/* Image Modal */
.image-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 30, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.image-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.image-modal.active {
  opacity: 1;
  visibility: visible;
}

.image-modal-content {
  position: relative;
  width: 70vw;
  height: 70vh;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e4ebe4;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
}

.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  background: #ffffff;
  border: 1px solid #e4ebe4;
  border-radius: 50%;
  color: #001e00;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-normal);
  z-index: 10000;
}

.image-modal-close:hover {
  background: #f2f7f2;
  border-color: #14a800;
  color: #14a800;
  transform: scale(1.05) rotate(90deg);
}

.image-modal-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 1rem;
  overflow: auto;
}

.image-modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* Responsive adjustments for image modal */
@media (max-width: 768px) {
  .image-modal-content {
    width: 90vw;
    height: 80vh;
  }
  
  .image-modal-close {
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* Custom Help Share Modal */
.custom-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 30, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1;
}

.modal-card {
  position: relative;
  width: min(400px, 90vw);
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 24px;
  border: 1px solid #e4ebe4;
  box-shadow: 0 12px 40px rgba(0, 30, 0, 0.12);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal.show .modal-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #001e00;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close-btn:hover {
  color: #14a800;
  transform: scale(1.1);
}

.modal-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #001e00;
  letter-spacing: -0.01em;
}

.modal-instruction-text {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 20px;
}

.share-link-box {
  display: flex;
  width: 100%;
  gap: 8px;
  background: #f4f7f4;
  border: 1px solid #e4ebe4;
  border-radius: 8px;
  padding: 4px;
  box-sizing: border-box;
}

#share-link-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #475569;
  font-size: 13px;
  padding: 8px 12px;
  width: 0; /* allows flex collapse */
}

#modal-copy-btn {
  background: #14a800;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#modal-copy-btn:hover {
  background: #118f00;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20, 168, 0, 0.15);
}

#modal-copy-btn:active {
  transform: translateY(0) scale(0.97);
}