/* Подключение шрифта Geologica Black для сертификата */
@font-face {
  font-family: 'Geologica Black';
  font-style: normal;
  font-weight: 900;
  src: url('/assets-am/fonts/geologica-black.ttf') format('truetype');
  font-display: swap;
}

/* Альтернативное имя без пробела */
@font-face {
  font-family: 'GeologicaBlack';
  font-style: normal;
  font-weight: 900;
  src: url('/assets-am/fonts/geologica-black.ttf') format('truetype');
  font-display: swap;
}

/* Подключение шрифта Futura PT Medium для номера сертификата */
@font-face {
  font-family: 'Futura PT Medium';
  font-style: normal;
  font-weight: 500;
  src: url('/assets-am/fonts/futuracyrillicmedium.ttf') format('truetype');
  font-display: swap;
}

/* Альтернативное имя без пробела */
@font-face {
  font-family: 'FuturaPTMedium';
  font-style: normal;
  font-weight: 500;
  src: url('/assets-am/fonts/futuracyrillicmedium.ttf') format('truetype');
  font-display: swap;
}

/* Модальное окно предпросмотра сертификата */
#certificatePreviewModal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.certificate-modal-content {
  background-color: #fefefe;
  margin: 2vh auto;
  padding: 0;
  border: 1px solid #888;
  width: 90%;
  max-width: 600px;
  max-height: calc(100vh - 4vh);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s;
  overflow: hidden;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.certificate-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  background-color: #f8f8f8;
  border-radius: 8px 8px 0 0;
}

.certificate-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.certificate-modal-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.certificate-modal-close:hover,
.certificate-modal-close:focus {
  color: #000;
}

.certificate-modal-body {
  padding: 20px;
  text-align: center;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

#certificate-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.certificate-preview-canvas {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  height: auto;
  width: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

/* Ссылка предпросмотра сертификата */
#previewCertBtn,
.certificate-preview-link {
  display: inline-flex;
  align-items: center;
  color: #11998e;
  text-decoration: underline;
  font-size: 16px;
  cursor: pointer;
  margin-top: 15px;
  transition: color 0.3s;
  border: none;
  background: none;
  padding: 0;
}

#previewCertBtn svg,
.certificate-preview-link svg {
  flex-shrink: 0;
  vertical-align: middle;
}

#previewCertBtn:hover,
.certificate-preview-link:hover {
  color: #0d7a70;
  text-decoration: none;
}

#previewCertBtn:active,
.certificate-preview-link:active {
  color: #0a5d55;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .certificate-modal-content {
    width: 95%;
    margin: 2vh auto;
    max-height: calc(100vh - 4vh);
  }
  
  .certificate-preview-canvas {
    max-height: calc(100vh - 180px);
  }

  .certificate-modal-header {
    padding: 12px 15px;
  }

  .certificate-modal-title {
    font-size: 18px;
  }

  .certificate-modal-body {
    padding: 15px;
  }

  #previewCertBtn,
  .certificate-preview-link {
    font-size: 13px;
    margin-top: 6px;
  }
}
