/* ==============================
   OLD ENGLISH FONT DECLARATION
   ============================== */

@font-face {
  font-family: 'OldEnglishTextMT';
  src: local('Old English Text MT'), local('OldEnglishTextMT');
  font-style: normal;
  font-weight: normal;
}

/* ==============================
   GLOBAL TYPOGRAPHY (STABLE)
   ============================== */

html, body {
  font-family: "Bookman Old Style", "Times New Roman", serif !important;
  font-size: 14px;
  color: #111;
  margin: 0;
  padding: 0;
}

/* FORCE INHERITANCE (PREVENT FLICKER) */
*, *::before, *::after {
  font-family: inherit !important;
}
/* ✅ IMPORTANT: PROTECT ICON FONTS */
i,
.bi,
[class^="bi-"],
[class*=" bi-"] {
  font-family: "bootstrap-icons" !important;
  font-style: normal;
}

/* FontAwesome icons */
.fa,
.fas,
.far,
.fab,
[class^="fa-"] {
  font-family: "Font Awesome 6 Free" !important;
}

/* ==============================
   FORM + UI FIX (BOOTSTRAP SAFE)
   ============================== */

input,
select,
textarea,
button,
.form-control,
.form-select {
  font-family: inherit !important;
  font-size: 14px;
  color: #111;
}

/* ==============================
   HEADER TEXT STYLES (LOCKED)
   ============================== */

.dep-rc-title,
.dep-sub {
  font-family: 'OldEnglishTextMT', 'Old English Text MT', serif !important;
  font-weight: normal !important;
  letter-spacing: 0.3px;
  text-rendering: optimizeLegibility;
}

/* EXACT SIZES (NO CHANGES EVER) */
.dep-rc-title {
  font-size: 11pt !important;
}

.dep-sub {
  font-size: 16pt !important;
}

/* ==============================
   EXTRA SAFETY (BOOTSTRAP OVERRIDE BLOCK)
   ============================== */

.modal,
.card,
.table,
#content,
.container {
  font-family: inherit !important;
}

/* ==============================
   ANTI FLICKER (IMPORTANT)
   ============================== */

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.border-dashed {
  border: 2px dashed #0d6efd;
  border-radius: 10px;
  background: #f8fbff;
  transition: 0.2s;
}
.border-dashed:hover {
  background: #eef5ff;
}

.ipcrf-icon {
  font-size: 40px;
  color: #dc3545;
}
.ipcrf-upload-card {
    border: 2px dashed #d1d5db;
    border-radius: 18px;
    transition: all .25s ease;
    background: #f9fafb;
    cursor: pointer;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ipcrf-upload-card:hover {
    border-color: #6366f1;
    background: #eef2ff;
    transform: translateY(-2px);
}

.ipcrf-upload-card.uploaded {
    border-color: #22c55e;
    background: #ecfdf5;
}

.ipcrf-upload-body {
    text-align: center;
}

.ipcrf-main-icon {
    font-size: 40px;
    color: #9ca3af;
    transition: .2s;
}

.ipcrf-upload-card:hover .ipcrf-main-icon {
    color: #6366f1;
}

.ipcrf-upload-card.uploaded .ipcrf-main-icon {
    color: #22c55e;
}

.ipcrf-title {
    font-weight: 600;
    margin-top: 6px;
    font-size: 14px;
}

.domain-title {
  background: #2c3e50 !important;
  color: white !important;
  font-weight: bold !important;
}

/* Modern spinner */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #1E3F66; /* Main color */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* Keyframes must be global, not inside media queries */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* === HEADER STYLES === */
.header {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 10px;
  position: relative;
}

.doc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
  font-size: 13px;
}
.doc-top .left { color: #111; }
.doc-top .right { font-style: italic; font-size: 13px; }

.dep-logo {
  display: block;
  margin: 0 auto 6px;
  width: 78px;
  height: auto;
}

.level-check {
  pointer-events: none;
  opacity: 1;
  cursor: default;
}
/* Add these styles to your CSS file */
.border-dashed {
    border: 2px dashed #dee2e6 !important;
}

.file-upload-area {
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
    border-color: #0d6efd !important;
}

.form-control-lg, .form-select-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.border-primary-subtle {
    border-color: #cfe2ff !important;
}

.bg-primary-subtle {
    background-color: #cfe2ff !important;
}
/* COI - YELLOW */
.row-coi {
  background-color: #fff8e1;
}
.row-coi td:first-child {
  border-left: 6px solid #ffc107;
}

/* NCOI - GREEN */
.row-ncoi {
  background-color: #e9f7ef;
}
.row-ncoi td:first-child {
  border-left: 6px solid #28a745;
}

.form-card {
  max-width: 980px;
  margin: 0 auto 30px;
}

.levels-checkboxes label {
  margin-right: 15px;
  cursor: pointer;
}

table td[contenteditable="true"] {
  background: #f9f9f9;
}

/* === PERFORMANCE TABLE HIGHLIGHT === */
.highlight-row {
  background-color: #f8fff8 !important;
  border: 2px solid #28a745 !important;
  border-radius: 6px;
  transition: all 0.25s ease-in-out;
}

#performanceTable tbody tr {
  transition: all 0.25s ease-in-out;
}

/* === TABLE HEADERS === */
table.table thead th {
  vertical-align: middle;
}
/* Overlay */
#qsLoadingOverlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#qsLoadingOverlay.active {
    opacity: 1;
    visibility: visible;
}

/* Wrapper */
.qs-loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* AURA BACKGROUND (glow circle) */
.logo-aura {
    width: 160px;
    height: 160px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(30, 63, 102, 0.25) 0%,
        rgba(30, 63, 102, 0.08) 40%,
        rgba(255,255,255,0) 70%
    );

    animation: auraPulse 2s ease-in-out infinite;
}

/* LOGO */
.loader-logo {
    width: 90px;
    height: 90px;

    object-fit: contain;

    animation: logoFloat 1.8s ease-in-out infinite;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.15));
}

/* TEXT */
.qs-loading-text {
    margin-top: 18px;
    font-size: 14px;
    color: #1E3F66;
    font-weight: 500;
    opacity: 0.85;
    animation: fadePulse 1.5s ease-in-out infinite;
}

/* ANIMATIONS */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-6px) scale(1.05);
    }
}

@keyframes auraPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes fadePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
/* EVALUATING LOADER */
#evalLoadingOverlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#evalLoadingOverlay.active {
    opacity: 1;
    visibility: visible;
}
.qs-loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center; /* ✅ ADD THIS */
}
/* =========================
   SUBMIT LOADER ONLY
========================= */

#submitLoadingOverlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;

    /* 🔥 IMPORTANT: hidden by default */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 🔥 SHOW ONLY WHEN ACTIVE */
#submitLoadingOverlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}
input[name="levels[]"] {
    cursor: not-allowed;
}
/* =======================================
   EDUCATION MODAL - CLEAN UNIFORM DESIGN
======================================= */

/* 🔥 GLOBAL FONT (COMPACT + CONSISTENT) */
#educationModal {
    font-size: 0.9rem;
}

#educationModal .form-label {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

#educationModal .form-control,
#educationModal .form-select {
    font-size: 0.85rem;
    padding: 6px 10px;
}

/* INPUT HEIGHT FIX */
#educationModal input[type="date"],
#educationModal select {
    height: 36px;
}

/* =======================================
   MODAL SCROLL
======================================= */
#educationModal .modal-body {
    max-height: 85vh;
    overflow-y: auto;
}

/* =======================================
   LEFT SIDE (RUBRICS + SUMMARY UNIFORM)
======================================= */
.education-rubrics-sticky {
    position: sticky;
    top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* 🔥 consistent spacing */
}

/* 🔥 MAKE BOTH CARDS IDENTICAL STYLE */
.education-rubrics-sticky .card {
    border: 1px solid #e5e7eb;
    border-left: 4px solid #28a745;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* 🔥 SAME HEADER STYLE */
.education-rubrics-sticky .card-header {
    background-color: #f8f9fa;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 12px;
}

/* 🔥 SAME BODY STYLE */
.education-rubrics-sticky .card-body {
    font-size: 0.83rem;
    padding: 12px;
}

/* REMOVE EXTRA STYLE DIFFERENCE */
.bg-light-green {
    background-color: #f8f9fa !important;
}

.border-light-green {
    border-left: 4px solid #28a745 !important;
}

.text-green {
    color: #198754 !important;
}

/* =======================================
   RUBRICS LIST IMPROVED
======================================= */
.education-rubrics-sticky .list-group-item {
    font-size: 0.8rem;
    padding: 8px 10px;
    border: none;
    border-bottom: 1px solid #f1f1f1;
}

.education-rubrics-sticky .list-group-item:last-child {
    border-bottom: none;
}

/* =======================================
   SUMMARY CARD (LOOK LIKE RUBRICS)
======================================= */
#modal_education_summary {
    font-size: 0.82rem;
    line-height: 1.4;
}

/* 🔥 LABEL STYLE */
#modal_education_summary strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

/* =======================================
   RIGHT SIDE FORM
======================================= */
.education-form-scroll {
    max-height: none;
    overflow: visible;
}

/* =======================================
   ROW SPACING
======================================= */
#educationModal .row.g-4 {
    --bs-gutter-y: 0.8rem;
}

#educationModal .row.g-3 {
    --bs-gutter-y: 0.6rem;
}

/* =======================================
   FILE UPLOAD DESIGN
======================================= */
.education-modal-border-dashed {
    border: 2px dashed #ced4da;
    transition: 0.2s;
}

.education-modal-border-dashed:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

/* =======================================
   INPUT BORDER CLEAN
======================================= */
.education-modal-border {
    border: 1px solid #ced4da;
    border-radius: 6px;
}

/* =======================================
   SMALL TEXT
======================================= */
.education-modal-form-text {
    font-size: 12px;
    color: #6c757d;
}

/* =======================================
   MOBILE FIX
======================================= */
@media (max-width: 768px) {

    #educationModal {
        font-size: 0.85rem;
    }

    .education-rubrics-sticky {
        position: relative;
        top: 0;
    }

    #educationModal .col-md-4,
    #educationModal .col-md-3,
    #educationModal .col-md-5 {
        width: 100%;
    }
}
/* ================= LEFT SIDE ================= */
.training-summary-sticky {
  position: relative;
  top: auto;
  width: 100%;
  max-height: none;
  overflow: visible;
}

/* Desktop only sticky behavior */
@media (min-width: 768px) {
  .training-summary-sticky {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 140px);
    overflow: hidden;
  }
}

/* ================= RIGHT SIDE ================= */
.modal-body > .col-md-8 {
  overflow-y: visible;
  max-height: none;
  font-size: 0.9rem;
}

/* Desktop scroll only */
@media (min-width: 768px) {
  .modal-body > .col-md-8 {
    overflow-y: auto;
    max-height: calc(100vh - 140px);
  }
}

/* ================= MODAL SAFETY FIX ================= */
.modal-body {
  overflow: hidden;
}

/* ================= TRAINING ITEM ================= */
.training-item {
  transition: all 0.3s ease;
  border-left: 4px solid #0d6efd !important;
}

.training-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

/* ================= BADGES / ICONS ================= */
.training-item .badge,
.training-item .remove-training i {
  font-size: 0.8rem;
  padding: 0.3em 0.5em;
}

/* ================= MOBILE IMPROVEMENTS ================= */
@media (max-width: 767px) {
  .modal-body {
    padding: 1rem !important;
  }

  .training-summary-sticky {
    margin-bottom: 1rem;
  }

  .modal-body .row {
    flex-direction: column;
  }

  .modal-body .col-md-4,
  .modal-body .col-md-8 {
    width: 100%;
  }
}
/* =========================
   GLOBAL FONT SIZE REDUCTION (TRAINING MODAL ONLY)
   ========================= */

#trainingModal {
  font-size: 12px; /* base font shrink */
}

/* LEFT + RIGHT ALL TEXT */
#trainingModal label,
#trainingModal .form-text,
#trainingModal .list-group-item,
#trainingModal .alert,
#trainingModal .card-body,
#trainingModal .card-header,
#trainingModal .modal-title {
  font-size: 12px;
}

/* HEADINGS SMALLER */
#trainingModal h6 {
  font-size: 13px;
}

/* INPUTS */
#trainingModal .form-control,
#trainingModal .form-select {
  font-size: 12px;
}

/* BUTTONS */
#trainingModal .btn {
  font-size: 12px;
}

/* BADGES */
#trainingModal .badge {
  font-size: 11px;
}

/* SMALL TEXT */
#trainingModal small {
  font-size: 11px;
}

/* ICONS KEEP SIZE BUT SLIGHTLY BALANCED */
#trainingModal i {
  font-size: 0.95em;
}
/* =========================
   ELIGIBILITY MODAL - COMPACT + RESPONSIVE
   ========================= */

/* BASE FONT SHRINK (MODAL ONLY) */
#eligibilityModal {
  font-size: 12px;
}

/* =========================
   ELIGIBILITY MODAL - GLOBAL FONT
   ========================= */
#eligibilityModal {
  font-size: 12px;
}

/* ================= LEFT SIDE ================= */
.eligibility-summary-sticky {
  width: 100%;
}

/* CARD STYLE */
.eligibility-summary-sticky .card {
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border-left: 4px solid #28a745;
}

/* HEADER */
.eligibility-summary-sticky .card-header {
  font-weight: 600;
  color: #1e7e34;
  background-color: #e9f7ef;
  font-size: 13px;
}

/* LIST ITEMS */
.eligibility-summary-sticky .list-group-item {
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 12px;
  color: #1e7e34;
}

/* SUMMARY TEXT */
.eligibility-summary-sticky .card-body {
  font-size: 12px;
}

/* BADGE */
.eligibility-summary-sticky .badge {
  font-size: 11px;
  padding: 0.3em 0.6em;
  font-weight: 600;
}

/* ================= RIGHT SIDE FORM ================= */
#eligibilityModal .form-label {
  font-size: 12px;
  font-weight: 600;
}

#eligibilityModal .form-control,
#eligibilityModal .form-select {
  font-size: 12px;
}

#eligibilityModal .form-text {
  font-size: 11px;
}

#eligibilityModal .card {
  font-size: 12px;
}

#eligibilityModal .btn {
  font-size: 12px;
}

/* ================= DESKTOP LAYOUT ================= */
@media (min-width: 768px) {

  .eligibility-left {
    border-right: 1px solid #dee2e6;
  }

  .eligibility-right {
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* ================= MOBILE LAYOUT ================= */
@media (max-width: 767px) {

  /* stack layout fix */
  #eligibilityModal .modal-body {
    flex-direction: column !important;
  }

  .eligibility-left {
    border-right: none !important;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
  }

  .eligibility-right {
    max-height: none !important;
    overflow: visible !important;
  }

  .eligibility-summary-sticky {
    position: relative !important;
  }

  /* full width columns */
  #eligibilityModal .col-md-4,
  #eligibilityModal .col-md-8 {
    max-width: 100%;
    flex: 0 0 100%;
  }
}
.bg-light-green {
  background-color: #e9f7ef !important;
}

.border-light-green {
  border-left: 4px solid #28a745 !important;
}

.text-green {
  color: #1e7e34 !important;
}
/* EVALUATION SPINNER DESIGN */
/* ================================
   SWEETALERT BLUR BACKDROP
   Same style as qsLoadingOverlay
================================ */

.qs-blur-backdrop {
    backdrop-filter: blur(6px) !important;
    background: rgba(255, 255, 255, 0.65) !important;
}

/* Corporate Popup */
.qs-corporate-popup {
    border-radius: 12px;
    padding: 35px 30px;
    background: #ffffff;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    border-top: 5px solid #1E3F66;
}

/* Title */
.qs-corporate-title {
    font-size: 18px;
    font-weight: 600;
    color: #1E3F66;
    letter-spacing: 0.5px;
}

/* Wrapper */
.qs-corporate-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

/* Spinner */
.qs-corporate-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(0,0,0,0.08);
    border-top: 5px solid #1E3F66;
    border-radius: 50%;
    animation: spinCorporate 0.9s linear infinite;
}

/* Text */
.qs-corporate-text {
    margin-top: 18px;
    font-size: 14px;
    color: #444;
    text-align: center;
    max-width: 280px;
    opacity: 0.9;
    animation: fadePulse 1.6s ease-in-out infinite;
}

/* Animations */
@keyframes spinCorporate {
    to { transform: rotate(360deg); }
}

@keyframes fadePulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}
/* Subtle breathing animation */
@keyframes fadePulse {
    0% { opacity: 0.4; }
    50% { opacity: 0.9; }
    100% { opacity: 0.4; }
}
/* === RESPONSIVE TWEAKS === */
@media (max-width: 576px) {
  .doc-top { flex-direction: column; gap: 6px; }
  .dep-logo { width: 64px; }
}
