/* Utility Classes */
.hide {
  display: none;
}

.body-no-scroll {
  overflow: hidden;
}

/* POPUP BASE */
#ai-popup-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: scroll;
}
@media(max-width:800px){
  #ai-popup{
    padding: 0 20px;
  }
}
#ai-popup {
  width: 100%;
  display: block;
  max-width: 900px;
  width: 100%;
  position: fixed;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  height: 100%;
  /*     overflow: scroll; */
}

#ai-popup-wrapper {
  background-color: white;
  padding: 30px 40px 40px;
  border-radius: 32px;
  height: auto;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  max-height: max-content;
}


.ai-popup-button-container {
  max-width: 900px;
  margin: 0 auto;
  justify-content: end;
}

#ai-close-popup {
  border-radius: 50%;
  border: none;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  float: right;
  background-color: #F9FAF2;
  position: relative;
}

#ai-close-popup:after {
  content: "✕";
  position: absolute;
  top: 51%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 19px;
  color: #007F00;
}

/* Text Wrapper */
.ai-popup-text-wrapper {
  max-width: 665px;
  margin: 0 auto;
  text-align: center;
}

.ai-popup-text-wrapper p {
  margin: 0;
}

/* STEP 1: Upload CV Options */
.ai-popup-options-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top:20px;
}
@media(max-width:600px){
  .ai-popup-options-container {
      flex-wrap: wrap;
  }
}

/* Upload Option Card */
.ai-popup-card {
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
  background-color: #F7F8F0;
  padding: 56px 24px;
  box-sizing: border-box;
  text-align: center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.ai-popup-card .cv-popup-checkbox-wrapper{
  display: flex;
  text-align: left;
  margin-bottom: 24px;
}
.ai-popup-card .cv-popup-checkbox-wrapper .checkbox-input {
  display: block;
  cursor: pointer;
}
.ai-popup-card .cv-popup-checkbox-wrapper .certify_text {
  font-size: 14px;
  line-height: 140%;
  letter-spacing: 0px;
  color: #646461;
  position: relative;
  padding-left: 36px; 
  user-select: none;
}
/* hide the native checkbox */
.ai-popup-card .cv-popup-checkbox-wrapper .checkbox-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}



/* the custom box */
.ai-popup-card .cv-popup-checkbox-wrapper .certify_text::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26%;
  transform: translateY(-50%);
  width: 23px;
  height: 23px;
  border: 1px solid #007F00;
  border-radius: 4px;
}

/* the checkmark (appears when input is checked) */
.ai-popup-card .cv-popup-checkbox-wrapper .checkbox-input:checked + .certify_text::after {
  font-size: 16px;
  color: #007F00;
  content: '';
  position: absolute;
  left: 9px;
  top: 21%;
  transform: translateY(-50%) rotate(45deg);
  width: 6px;
  height: 12px;
  border: solid #007F00;
  border-width: 0 1px 1px 0;
}


/* .ai-popup-card:hover {
  border-color: #28a745;
  box-shadow: 0 0 0 3px #28a74533;
} */

/* Card Icon */
.ai-popup-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0px;
  height: 60px;
  /* or adjust as needed */
}

.ai-popup-image-wrapper img {
  max-width: 48px;
  max-height: 48px;
}

/* Card Description */
.ai-popup-card p {
  font-size: 16px;
  line-height: 1.4;
  color: #646461;
  font-family: 'Roboto';
  margin: 0px 0px 24px;
}

/* Upload Button */
.ai-popup-card button {
  background-color: #007F00;
  color: #F7F8F0;
  height:48px;
  padding: 12px 24px;
  width: fit-content;
  font-family: 'Roboto';
  margin: 0 auto;
  border-radius: 25px;
  font-weight: 400;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
@media (max-width: 350px) {
  .ai-popup-card button{
     height:auto;
  }
}
.ai-popup-card button.disabled {
  background-color: #9BC599;
  pointer-events: none;  /* blocks clicks */
  cursor: not-allowed;
}

/* .ai-popup-card button:hover {
  background-color: #28a745;
  color: white;
} */

/* STEP 2: Progress Bar */
.ai-progress-wrapper {
  width: 100%;
  height: 10px;
  background-color: #e6e6e6;
  /* light grey background */
  border-radius: 5px;
  overflow: hidden;
  margin-top: 20px;
  position: relative;
}

.ai-popup-step-2 .ai-cv-processing-container {
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  background-color: #fff;
  padding: 40px 30px;
  min-width: 233px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}


.ai-progress-bar-grey {
  width: 100%;
  height: 10px;
  background-color: #e6e6e6;
  /* light grey */
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.ai-progress-bar {
  width: 0%;
  /* will be updated dynamically */
  height: 100%;
  background-color: #007f00;
  /* deep green */
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 5px;
  transition: width 0.4s ease;
}

/* STEP 3 Scrollable Table */
#ai-popup-step-3 {
/*   max-height: 60vh; */
/*   padding-right: 8px; */
  box-sizing: border-box;
}

#ai-popup-step-3 .text-center {
  font-family: 'Roboto';
  font-weight: 400;
  font-size: 22px;
  color: #363635;

}

#ai-count-extracted-fields-text {
  color: #646461;
  font-weight: 400;
  margin-bottom: 10px;
  font-size: 16px;
  font-family: 'Roboto';
}

#ai-extracted-fields-wrapper {
  max-height: 40vh;
  overflow-y: auto;
  box-sizing: border-box;
}


#ai-cv-extract-table th {
  color: #007f00;
  padding: 12px 8px;
  line-height: 28px;
  font-size: 16px;
  text-align: left;
  font-weight: 400;
}

#ai-cv-extract-table td {
  padding: 12px 4px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  color: #646461;
  font-weight: 400;
  line-height: 28px;
  font-size: 16px;
  
}
#ai-cv-extract-body > tr > td > button.remove-field{
  color: #007F00;
    font-size: 31px;
    font-weight: 200;
}

#ai-cv-extract-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Roboto';
  font-size: 14px;
}

#ai-cv-extract-table thead {
  border-bottom: 1px solid #ccc;
}



#ai-cv-extract-table td:nth-child(2) {
  max-width: 460px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Optional (for nice scrollbar) */
#ai-extracted-fields-wrapper::-webkit-scrollbar {
  width: 8px;
}

#ai-extracted-fields-wrapper::-webkit-scrollbar-thumb {
  background-color: #007f00;
  border-radius: 4px;
}

#ai-popup-step-3 button[onclick="updateFormFields()"],
#ai-popup-step-4 button[onclick="hideAiCvPopup()"]{
  background-color: #007F00;
  color: #F7F8F0;
  font-family: 'Roboto';
  width: fit-content;
  margin: 0 auto;
  font-size: 16px;
  padding: 12px 32px;
  border: none;
  border-radius: 64px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#ai-popup-step-3 button[onclick="updateFormFields()"]:hover,
#ai-popup-step-4 button[onclick="hideAiCvPopup()"]:hover{
  background-color: #005e00;
}

/* #ai-extracted-fields-wrapper {
  background-color: #fafafa;
  border-radius: 12px;
  padding: 12px;
} */
/* Animations */
@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translate(-50%, -50%);
    opacity: 1;
  }

  to {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

#ai-popup.show {
  animation: slideUp 0.5s ease-out forwards;
}

#ai-popup.hide {
  animation: slideDown 0.5s ease-in forwards;
}

#ai-popup-overlay.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

#ai-popup-overlay.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
  .ai-popup-options-container {
    flex-direction: column;
    align-items: center;
  }

  .ai-popup-card {
    padding: 24px;
  }
#ai-popup-wrapper{
  padding:30px 20px;
}
  #ai-popup {
    top: 50%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    width: 90%;
    border-radius: 32px;
    
  }
}