/* ==========================================================================
   OFFICIAL TATA STEEL UISL 2-SECTION CERTIFICATE DIPLOMA & DOCUMENT PREVIEW
   Shared across: HR, Super Admin, BU-HR, HOD, and Employee Directory
   ========================================================================== */

/* Modal Backdrop & Container with Scale/Fade Animation */
.cert-preview-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
}

.cert-preview-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.cert-preview-modal-dialog {
  width: min(960px, 98vw);
  max-height: min(92vh, 880px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(18px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-preview-modal-backdrop.is-open .cert-preview-modal-dialog {
  transform: scale(1) translateY(0);
}

body.dark-mode .cert-preview-modal-dialog,
html[data-theme="dark"] .cert-preview-modal-dialog {
  background: #111c2e;
  color: #f1f5f9;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Modal Header */
.cert-modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
}

body.dark-mode .cert-modal-header,
html[data-theme="dark"] .cert-modal-header {
  background: #111c2e;
  border-bottom-color: #1e293b;
}

.cert-modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.cert-modal-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(79, 70, 229, 0.15));
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.cert-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

body.dark-mode .cert-modal-title,
html[data-theme="dark"] .cert-modal-title {
  color: #f8fafc;
}

.cert-modal-subtitle {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cert-modal-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.cert-modal-icon-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: translateY(-1px);
}

body.dark-mode .cert-modal-icon-btn,
html[data-theme="dark"] .cert-modal-icon-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

/* Modal Body */
.cert-modal-body {
  padding: 16px 22px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* 2-Section Tab Selector */
.certificate-preview-tabs {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 18px;
}

body.dark-mode .certificate-preview-tabs,
html[data-theme="dark"] .certificate-preview-tabs {
  background: #1e293b;
}

.cert-tab-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cert-tab-btn:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.6);
}

body.dark-mode .cert-tab-btn:hover,
html[data-theme="dark"] .cert-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.cert-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.dark-mode .cert-tab-btn.active,
html[data-theme="dark"] .cert-tab-btn.active {
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   SECTION 1: TATA STEEL UISL CERTIFICATE DIPLOMA
   -------------------------------------------------------------------------- */
.certificate-diploma-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  animation: certCardFadeIn 0.35s ease both;
}

body.dark-mode .certificate-diploma-card,
html[data-theme="dark"] .certificate-diploma-card {
  background: #0f172a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.cert-diploma-border {
  border: 4px double #b45309;
  border-radius: 12px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.28) 0%, rgba(255, 255, 255, 0.95) 50%, rgba(254, 243, 199, 0.28) 100%);
}

body.dark-mode .cert-diploma-border,
html[data-theme="dark"] .cert-diploma-border {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.15) 0%, rgba(15, 23, 42, 0.95) 50%, rgba(180, 83, 9, 0.15) 100%);
  border-color: #d97706;
}

.cert-diploma-inner {
  border: 1px solid rgba(180, 83, 9, 0.3);
  border-radius: 8px;
  padding: 32px 26px;
  text-align: center;
  position: relative;
  background: #ffffff;
}

body.dark-mode .cert-diploma-inner,
html[data-theme="dark"] .cert-diploma-inner {
  background: #131d33;
}

.cert-diploma-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(180, 83, 9, 0.2);
}

.cert-company-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #002d62;
  text-transform: uppercase;
}

body.dark-mode .cert-company-title,
html[data-theme="dark"] .cert-company-title {
  color: #60a5fa;
}

.cert-diploma-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  letter-spacing: 0.5px;
}

body.dark-mode .cert-diploma-badge,
html[data-theme="dark"] .cert-diploma-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.cert-diploma-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #0b2545;
  text-transform: uppercase;
  margin-bottom: 6px;
}

body.dark-mode .cert-diploma-title,
html[data-theme="dark"] .cert-diploma-title {
  color: #e2e8f0;
}

.cert-diploma-sub {
  font-size: 13px;
  color: #64748b;
  font-style: italic;
  margin-bottom: 14px;
}

.cert-recipient-name {
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  font-family: inherit;
}

body.dark-mode .cert-recipient-name,
html[data-theme="dark"] .cert-recipient-name {
  color: #f1f5f9;
}

.cert-recipient-meta {
  font-size: 13px;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

body.dark-mode .cert-recipient-meta,
html[data-theme="dark"] .cert-recipient-meta {
  color: #94a3b8;
}

.cert-diploma-desc {
  font-size: 14px;
  color: #64748b;
  max-width: 620px;
  margin: 0 auto 10px;
  line-height: 1.55;
}

.cert-course-name {
  font-size: 22px;
  font-weight: 800;
  color: #1d4ed8;
  margin-bottom: 4px;
}

body.dark-mode .cert-course-name,
html[data-theme="dark"] .cert-course-name {
  color: #93c5fd;
}

.cert-course-category {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b45309;
  font-weight: 700;
  margin-bottom: 26px;
}

.cert-diploma-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(180, 83, 9, 0.2);
}

.cert-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
}

.cert-meta-value {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

body.dark-mode .cert-meta-value,
html[data-theme="dark"] .cert-meta-value {
  color: #e2e8f0;
}

.cert-meta-dates {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.cert-gold-seal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef08a, #f59e0b 60%, #b45309 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.35);
  border: 2px dashed #fef3c7;
  font-size: 18px;
}

.cert-gold-seal span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.cert-signature-font {
  font-family: 'Brush Script MT', cursive, sans-serif;
  font-size: 26px;
  color: #1e3a8a;
  display: block;
}

body.dark-mode .cert-signature-font,
html[data-theme="dark"] .cert-signature-font {
  color: #93c5fd;
}

.cert-signatory-title {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  border-top: 1px solid #cbd5e1;
  padding-top: 4px;
  margin-top: 2px;
}

body.dark-mode .cert-signatory-title,
html[data-theme="dark"] .cert-signatory-title {
  color: #e2e8f0;
  border-top-color: #334155;
}

.cert-signatory-org {
  font-size: 10px;
  color: #64748b;
}

/* --------------------------------------------------------------------------
   SECTION 2: ATTACHED DOCUMENT PREVIEW
   -------------------------------------------------------------------------- */
.cert-document-preview-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  animation: certCardFadeIn 0.35s ease both;
}

body.dark-mode .cert-document-preview-box,
html[data-theme="dark"] .cert-document-preview-box {
  background: #1e293b;
  border-color: #334155;
}

.cert-document-iframe {
  width: 100%;
  height: 520px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

body.dark-mode .cert-document-iframe,
html[data-theme="dark"] .cert-document-iframe {
  border-color: #475569;
}

.cert-image-preview-img {
  max-height: 520px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Modal Footer */
.cert-modal-footer {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

body.dark-mode .cert-modal-footer,
html[data-theme="dark"] .cert-modal-footer {
  background: #111c2e;
  border-top-color: #1e293b;
}

/* --------------------------------------------------------------------------
   EMPLOYEE DIRECTORY PREVIEW & DOWNLOAD BUTTON ANIMATIONS
   -------------------------------------------------------------------------- */
.certificate-preview-btn,
.certificate-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

/* Preview Button with subtle gradient and glow animation */
.certificate-preview-btn {
  border: 1px solid #d9e2ec;
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.06);
}

.certificate-preview-btn i {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.certificate-preview-btn:hover {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
}

.certificate-preview-btn:hover i {
  transform: scale(1.22);
}

.certificate-preview-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

/* Download Button with high-energy animated shimmer */
.certificate-download-btn {
  border: 1px solid #2563eb;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.24);
}

.certificate-download-btn i {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.certificate-download-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
  color: #ffffff !important;
}

.certificate-download-btn:hover i {
  transform: translateY(2px) scale(1.15);
}

.certificate-download-btn:active {
  transform: translateY(0);
}

/* Shimmer animation bar on download button */
.certificate-download-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: none;
}

.certificate-download-btn:hover::after {
  animation: certBtnShimmer 0.8s ease-in-out infinite;
}

@keyframes certBtnShimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes certCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

