/* ==========================================================================
   Modals & Menus CSS - Accredible / British Council
   Styles for Dropdown Menus, Dialog Modals, Tooltips, and Bottom Sheets
   ========================================================================== */

:root, body {
  --theme-outline-color: #00a5ae;
  --theme-hover-color: #ff00c8;
}

/* --------------------------------------------------------------------------
   Focus Rings and Outlines
   -------------------------------------------------------------------------- */
#modalHelp a,
#modalHelp a:focus,
#modalHelp a:focus-visible {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

body .mat-mdc-menu-item.show-outline:focus,
body .mat-mdc-menu-item.show-outline:focus-visible {
  outline: 4px solid var(--theme-outline-color, #00a5ae) !important;
  outline-offset: -4px !important;
}

/* --------------------------------------------------------------------------
   Button Active States (When Menus/Modals are open)
   -------------------------------------------------------------------------- */
.menu-container button[data-cy="btn-export"].active-dropdown,
.menu-container button#credentialMenuTriggerButton.active-dropdown {
  background-color: #dedede !important;
  box-shadow: none !important;
}

.menu-container button#rmi-help.active-dropdown {
  background-color: transparent !important;
  box-shadow: none !important;
}

.menu-container button.active-dropdown .mdc-button__label,
.menu-container button.active-dropdown span:not([class*="icon-"]):not([class*="material-icons"]) {
  color: rgb(255, 0, 200) !important;
}

.menu-container button#credentialMenuTriggerButton.active-dropdown mat-icon,
.menu-container button#credentialMenuTriggerButton.active-dropdown .material-icons {
  color: rgb(255, 0, 200) !important;
}

.menu-container button[data-cy="btn-export"].active-dropdown accredible-icon,
.menu-container button[data-cy="btn-export"].active-dropdown [class*="icon-"],
.menu-container button#rmi-help.active-dropdown accredible-icon,
.menu-container button#rmi-help.active-dropdown [class*="icon-"] {
  color: #000000 !important;
}

/* --------------------------------------------------------------------------
   Tooltips
   -------------------------------------------------------------------------- */
#privateTooltip {
  display: none;
  position: fixed;
  background: #262626;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  pointer-events: none;
  font-family: 'British Council Sans', sans-serif;
}

#privateTooltip .arrow-up {
  position: absolute;
  bottom: 100%;
  right: 20px;
  border: 6px solid transparent;
  border-bottom-color: #262626;
}

#tooltipDownload,
#tooltipMore {
  display: none;
  position: fixed;
  margin: 0 !important;
  z-index: 100001;
  pointer-events: none;
  transform-origin: center bottom;
}

.mat-mdc-tooltip-surface {
  background: rgb(51, 51, 51) !important;
  color: rgb(255, 255, 255) !important;
  font-family: 'British Council Sans', sans-serif !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 16px !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  min-height: 24px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

/* --------------------------------------------------------------------------
   Desktop Menus: Download & More
   -------------------------------------------------------------------------- */
#downloadMenu {
  display: none;
  position: fixed;
  z-index: 100000;
  width: 280px;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px,
              rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
              rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
  padding: 15px;
  transform-origin: left top;
  font-family: 'British Council Sans', sans-serif;
}

#moreMenu {
  display: none;
  position: fixed;
  z-index: 100000;
  min-width: 178.36px;
  width: max-content;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px,
              rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
              rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
  padding: 0;
  transform-origin: right top;
  font-family: 'British Council Sans', sans-serif;
}

/* --------------------------------------------------------------------------
   Modal Backdrop and Containers (Help & Verify)
   -------------------------------------------------------------------------- */
#modalBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.32) !important;
  z-index: 99998;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#modalHelp {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  max-width: 90vw;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px,
              rgba(0, 0, 0, 0.14) 0px 24px 38px 3px,
              rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
  z-index: 99999;
  box-sizing: border-box;
  font-family: 'British Council Sans', sans-serif;
  transform-origin: center center;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Verify Credential Dialog (Angular Material MDC 1:1)
   -------------------------------------------------------------------------- */
#modalVerifyContainer {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  width: 700px;
  max-width: 90vw;
  box-sizing: border-box;
  font-family: 'British Council Sans', sans-serif;
  color: rgb(0, 0, 0);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

#modalVerifyContainer .mat-mdc-dialog-inner-container {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
}

#modalVerifyContainer .mat-mdc-dialog-surface {
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: #ffffff;
  border-radius: 4px;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px,
              rgba(0, 0, 0, 0.14) 0px 24px 38px 3px,
              rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

#modalVerifyContainer .header {
  display: flex;
  flex-direction: column;
  padding: 24px 24px 8px 24px;
  box-sizing: border-box;
}

#modalVerifyContainer .mat-mdc-dialog-title {
  display: block;
  padding: 0px 50px 0px 0px;
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 32px;
  letter-spacing: 0.15px;
  color: rgb(0, 0, 0);
  font-family: 'British Council Sans', sans-serif;
}

#modalVerifyContainer .close-dialog {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
}

#modalVerifyContainer .close-dialog button {
  width: 40px;
  height: 40px;
  padding: 0;
  box-sizing: border-box;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

#modalVerifyContainer .close-dialog button.close-btn-focus-ring,
#modalVerifyContainer .close-dialog button:focus-visible {
  outline: none;
  background: #dedede;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #008489;
}

#modalVerifyContainer .close-dialog button:hover:not(.close-btn-focus-ring) {
  background-color: #f1f3f4;
}

#modalVerifyContainer .close-dialog button mat-icon {
  font-size: 24px;
  width: 24px;
  height: 24px;
  line-height: 24px;
}

#modalVerifyContent {
  display: block;
  padding: 16px 24px 28px 24px;
  box-sizing: border-box;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: rgb(0, 0, 0);
  max-height: 585px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Windows desktop scrollbar matching production 1:1 */
#modalVerifyContent::-webkit-scrollbar {
  width: 14px;
}

#modalVerifyContent::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#modalVerifyContent::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border: 1px solid #f1f1f1;
}

#modalVerifyContent::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.verify-dialog {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.verify-dialog > .verify-slot,
.verify-dialog > div:not(:last-child) {
  padding: 16px 0;
  box-sizing: border-box;
}

.verify-dialog > .verify-slot:first-child,
.verify-dialog > div:first-child {
  padding-top: 4px;
}

.verify-dialog > .verify-slot:last-child,
.verify-dialog > div:last-child {
  padding-bottom: 8px;
}

/* Dividers are hidden in the verified modal per live site */
.verify-dialog accredible-divider,
.verify-dialog .mat-divider {
  display: none !important;
}

/* Smooth Fade In Transition */
.verify-fade-in {
  animation: acr-fade-in 0.28s ease-out forwards;
}

@keyframes acr-fade-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections inside verify-dialog */
.verify-dialog .credential {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

.verify-dialog .credential .verified-icon {
  color: #2e7d32;
  flex-shrink: 0;
  display: inline-flex;
}

.verify-dialog .credential .mat-h2 {
  font-size: 20px;
  font-weight: 400;
  line-height: 32px;
  letter-spacing: 0.15px;
  color: rgb(0, 0, 0);
  margin: 0 0 6px;
}

.verify-dialog .credential .mat-h2 strong {
  font-weight: 700;
}

.verify-dialog .credential .credential-desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.25px;
  color: rgb(0, 0, 0);
}

.verify-dialog .verified-message {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0 0 15px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.25px;
  color: rgb(0, 0, 0);
}

.verify-dialog .verified-message accredible-icon,
.verify-dialog .verified-message .status-check-icon {
  color: #2e7d32;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
}

.verify-dialog .issuer-content,
.verify-dialog .recipient-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.verify-dialog .trailing-margin {
  margin-right: 4px;
}

.verify-dialog .avatar-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verify-dialog .avatar-bc-owner {
  background-color: #b15703;
  border: none !important;
}

.verify-dialog .mat-h3 {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.15px;
  color: rgb(0, 0, 0);
  margin: 0 0 4px;
}

.verify-dialog a.verify-link {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.25px;
  color: #23085a;
  text-decoration: underline;
  cursor: pointer;
}

.verify-dialog a.verify-link:hover {
  color: #160538;
}

.verify-dialog .blockchain > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.verify-dialog .blockchain-secured {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.15px;
  color: rgb(0, 0, 0);
  margin-bottom: 8px;
}

.verify-dialog .blockchain-secured accredible-icon,
.verify-dialog .blockchain-secured .lock-icon {
  color: #000000;
  font-size: 20px;
  display: inline-flex;
}

.verify-dialog .blockchain-id {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 16px;
  line-height: 24px;
  padding-top: 2px;
}

.verify-dialog .blockchain-id-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgb(0, 0, 0);
}

.verify-dialog .blockchain-id-label accredible-icon,
.verify-dialog .blockchain-id-label .bitcoin-icon {
  color: #f7931a;
  font-size: 20px;
  display: inline-flex;
}

.verify-dialog .blockchain-address {
  font-weight: 700;
  color: rgb(0, 0, 0);
  margin-left: 10px;
}

.verify-dialog .credential-details > div.credential-dates {
  display: flex;
  flex-direction: row;
  margin-bottom: 16px;
}

.verify-dialog .credential-details > div.credential-dates > div:first-child {
  margin-right: 48px;
}

.verify-dialog .mat-h4 {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.1px;
  text-transform: uppercase;
  color: rgb(0, 0, 0);
  margin: 0 0 8px;
}

.verify-dialog .credential-date-val {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.25px;
  color: rgb(0, 0, 0);
}

.verify-dialog .mat-subtitle-2 {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.25px;
  color: rgb(0, 0, 0);
}

.verify-dialog .history {
  display: block;
  margin-top: 16px;
}

.verify-dialog .history ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.verify-dialog .history li {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.25px;
  color: rgb(0, 0, 0);
}

.verify-dialog .history-bullet {
  font-size: 24px;
  line-height: 1;
  color: rgb(0, 0, 0);
  user-select: none;
}

/* Verifying Spinner States */
.verify-dialog .verifying {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

/* Item 3 in verifying state has spinner on top, text underneath */
.verify-dialog .blockchain .verifying,
.verify-dialog .verifying-stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.verify-dialog .verifying-text-lg {
  font-size: 20px;
  font-weight: 400;
  line-height: 32px;
  letter-spacing: 0.15px;
  color: rgb(0, 0, 0);
}

.verify-dialog .verifying-text-sm {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.25px;
  color: rgb(0, 0, 0);
}

/* Indeterminate Circular Spinner Animations - Dark Purple Arc without background circle */
.acr-mdc-spinner {
  border-radius: 50%;
  animation: acr-spinner-rot 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-sizing: border-box;
  flex-shrink: 0;
}

.acr-mdc-spinner-40 {
  width: 40px;
  height: 40px;
  border: 3.5px solid transparent;
  border-top-color: #23085a;
  border-right-color: #23085a;
}

.acr-mdc-spinner-25 {
  width: 25px;
  height: 25px;
  border: 2.5px solid transparent;
  border-top-color: #23085a;
  border-right-color: #23085a;
}

@keyframes acr-spinner-rot {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Mobile Bottom Sheets (Accredible / British Council 1:1)
   -------------------------------------------------------------------------- */
.bottom-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bottom-sheet-backdrop.visible {
  display: block;
}

.bottom-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-popup-overlay-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100001;
  pointer-events: none;
  justify-content: center;
  align-items: flex-end;
}

.mobile-popup-overlay-wrapper.visible {
  display: flex;
}

.mobile-popup-overlay-wrapper .pop-up-content {
  display: block;
  width: 100%;
  max-width: 100vw;
  background-color: #ffffff;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  overflow: hidden;
  pointer-events: auto;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.61, 1, 0.88, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  font-family: 'British Council Sans', sans-serif;
  box-sizing: border-box;
}

.mobile-popup-overlay-wrapper.active .pop-up-content {
  transform: translateY(0);
}

/* Header inside sheet */
.mobile-popup-overlay-wrapper .pop-up-content .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 15px 0px;
  margin: 0px 0px 10px;
  border-bottom: none;
}

.mobile-popup-overlay-wrapper .pop-up-content .header h3 {
  font-size: 18.72px;
  font-weight: 700;
  line-height: 24px;
  color: rgb(0, 0, 0);
  margin: 0;
  padding: 0;
  font-family: 'British Council Sans', sans-serif;
}

.mobile-popup-overlay-wrapper .pop-up-content .header button.close-dialog-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 24px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(0, 0, 0);
  outline: none;
}

.mobile-popup-overlay-wrapper .pop-up-content .header button.close-dialog-btn mat-icon {
  font-size: 24px;
  width: 24px;
  height: 24px;
  line-height: 24px;
  color: rgb(0, 0, 0);
}

/* Content list inside sheet */
.mobile-popup-overlay-wrapper .mobile-popup {
  display: block;
  padding: 0px 16px 16px;
  box-sizing: border-box;
}

.mobile-popup-overlay-wrapper .mobile-popup ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-popup-overlay-wrapper .mobile-popup ul li {
  margin: 0;
  padding: 0;
}

.mobile-popup-overlay-wrapper .mobile-popup ul li:not(:last-of-type) .mat-mdc-menu-item {
  border-bottom: 1px solid rgb(224, 224, 228);
}

.mobile-popup-overlay-wrapper .mat-mdc-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
  padding: 0px 16px;
  box-sizing: border-box;
  font-family: 'British Council Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: rgb(99, 100, 122);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mobile-popup-overlay-wrapper .mat-mdc-menu-item:hover,
.mobile-popup-overlay-wrapper .mat-mdc-menu-item:focus {
  background-color: rgba(0, 0, 0, 0.04);
  text-decoration: none;
}

.mobile-popup-overlay-wrapper .mat-mdc-menu-item-text {
  display: flex;
  align-items: center;
  width: 100%;
}

.mobile-popup-overlay-wrapper .mat-mdc-menu-item-text accredible-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16.25px;
  height: 24px;
  margin-right: 8px;
  font-size: 16px;
  color: rgb(99, 100, 122);
}

.mobile-popup-overlay-wrapper .mat-mdc-menu-item-text [class*="icon-"] {
  font-size: 16px;
  color: rgb(99, 100, 122);
}

/* Download Group Title */
.mobile-popup-overlay-wrapper .group-title.mat-body {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: rgb(0, 0, 0);
  margin: 0px 0px 0px 0px;
  padding: 0;
  font-family: 'British Council Sans', sans-serif;
}

.mobile-popup-overlay-wrapper .download-item {
  width: 100%;
  height: 48px;
  padding: 0px 16px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.mobile-popup-overlay-wrapper .download-item .text-and-icon {
  display: flex;
  align-items: center;
  width: 100%;
}

.mobile-popup-overlay-wrapper .download-item .text-and-icon accredible-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16.25px;
  height: 24px;
  margin-right: 8px;
  color: rgb(0, 0, 0);
  font-size: 16px;
}

.mobile-popup-overlay-wrapper .download-item .text-and-icon [class*="icon-"] {
  color: rgb(0, 0, 0);
  font-size: 16px;
}

.mobile-popup-overlay-wrapper .download-item .text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex: 1;
}

.mobile-popup-overlay-wrapper .download-item .text span:first-child {
  font-size: 16px;
  font-weight: 400;
  color: rgb(0, 0, 0);
  font-family: 'British Council Sans', sans-serif;
}

.mobile-popup-overlay-wrapper .download-item .text .format-hint {
  font-size: 16px;
  font-weight: 400;
  color: rgb(130, 131, 149);
  text-align: right;
  font-family: 'British Council Sans', sans-serif;
}
