/* 
   ==========================================================================
   Naseej Custom Overrides & Additions
   These styles have been manually extracted from the legacy style.css
   to preserve the base style-src.css integrity.
   ========================================================================== 
*/

:root {
    --header-height: 82px;
}

/* =========================================
   Header Layout Adjustments
   ========================================= */
@media (max-width: 991px) {
    header.site-header .header-row {
        min-height: 70px !important;
    }
    header.site-header .brand-logo-image {
        height: 40px !important;
    }
}

@media (max-width: 575px) {
    header.site-header .header-row {
        min-height: 64px !important;
    }
    header.site-header .brand-logo-image {
        height: 34px !important;
    }
}

/* =========================================
   Program Icon Background Colors
   ========================================= */
.program-icon.green-dark {
    background: var(--green-800);
}
.program-icon.green-light {
    background: #8cb435;
}
.program-icon.lime {
    background: #b4c435;
}

/* =========================================
   Program Card Status Badges
   ========================================= */
.state.ended {
    color: #9aa6a1;
    background: #f4f6f5;
    border-color: #dbe3df;
}
.state.new {
    color: #2b8d56;
    background: #e8f4ed;
    border-color: #cde5d7;
}
.state.soon {
    color: #8f8f2b;
    background: #f4f4df;
    border-color: #e6e3ba;
}
.state.open {
    color: #347a58;
    background: #e8f4ed;
    border-color: #cde5d7;
}

/* =========================================
   Authentication Additions (Validation & Loader)
   ========================================= */
.auth-validation-summary.validation-summary-valid,
.auth-validation-summary:empty,
.auth-validation-summary:not(.validation-summary-errors) {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

.auth-validation-summary {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
    line-height: 1.6;
    text-align: right;
    direction: rtl;
}

.auth-validation-summary ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.btn-auth.is-loading {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}

.btn-auth.is-loading::after {
    content: "";
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-btn-spin 0.6s linear infinite;
    top: calc(50% - 0.625rem);
    left: calc(50% - 0.625rem);
}

@keyframes auth-btn-spin {
    to { transform: rotate(360deg); }
}

.auth-card .btn-auth:hover {
    background: var(--green-800);
    transform: translateY(-1px);
}

/* =========================================
   Pagination Styles 
   ========================================= */
.page-pagination a:hover {
    background: var(--green-200);
    border-color: var(--green-300);
}
.page-pagination .active {
    background: var(--green-700);
    color: #fff;
    border-color: var(--green-700);
}
.page-pagination .dots {
    border: none;
    background: none;
}

/* =========================================
   Authenticated User Menu (shared with admin topbar)
   ========================================= */
.admin-user {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  direction: rtl;
  position: relative;
}

.admin-user__menu {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: #111827;
  display: grid;
  place-items: center;
}

.admin-user__menu img {
  width: 24px;
  height: 24px;
  display: block;
  transition: transform 0.2s ease;
}

.admin-user.is-open .admin-user__menu img {
  transform: rotate(180deg);
}

.admin-user__identity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  direction: rtl;
  line-height: 1.2;
}

.admin-user__identity strong {
  font-size: 18px;
  font-weight: 600;
  color: #101828;
  width: 100%;
  text-align: right;
}

.admin-user__identity span {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #475467;
  width: 100%;
  text-align: right;
}

.admin-user__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(27, 131, 84, 0.1);
  color: #1b8354;
  overflow: hidden;
}

.admin-user__avatar img {
  width: 20px;
  height: 20px;
  display: block;
}

/* Real user photo fills the whole circle (the icon fallback keeps the 20px rule above) */
.admin-user__avatar img.admin-user__avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.admin-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.14);
  padding: 8px;
  z-index: 220;
}

.admin-user-dropdown[hidden] {
  display: none;
}

.admin-user-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: right;
  gap: 8px;
  width: 100%;
  border-radius: 8px;
  padding: 9px 10px;
  color: #1f2937;
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  background: transparent;
  border: none;
}

.admin-user-dropdown__item:hover {
  background: #f3f4f6;
}

.admin-user-dropdown__item i {
  font-size: 16px;
}

.admin-user-dropdown__item.is-danger {
  color: #b42318;
}

/* =========================================
   Program Details body — preserve line breaks
   ========================================= */
.program-description-body {
    white-space: pre-line;
}

/* =========================================
   Trainee pre-survey page — title alignment
   Combines both body classes for higher specificity than
   `body.trainee-dashboard-page .trainee-page-head` in trainee-dashboard.css
   (which loads later and would otherwise force the title to the left in RTL).
   ========================================= */
body.trainee-dashboard-page.trainee-survey-page .trainee-page-head {
  align-items: flex-start;
}

body.trainee-dashboard-page.trainee-survey-page .trainee-page-head h1 {
  align-self: flex-start;
  text-align: right;
}

/* =========================================
   Trainee pre-survey page — form controls
   ========================================= */
.trainee-survey-freetext {
  padding: 16px 24px 24px;
}
.trainee-survey-freetext textarea {
  width: 100%;
  min-height: 140px;
  border-radius: 12px;
  resize: vertical;
}
.trainee-survey-error {
  margin: 0 24px 16px;
  color: #dc3545;
  font-weight: 500;
}

/* =========================================
   Trainee pre-survey page — native radio styling
   Server-side flow uses real <input type="radio"> wrapped in <label class="trainee-survey-option">.
   Hide the input, drive the selected look via :has(input:checked).
   ========================================= */
body.trainee-dashboard-page.trainee-survey-page label.trainee-survey-option {
  cursor: pointer;
}
body.trainee-dashboard-page.trainee-survey-page .trainee-survey-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
body.trainee-dashboard-page.trainee-survey-page .trainee-survey-option:has(input[type="radio"]:checked) {
  border-color: #d8e8df;
  background: #fff;
}
body.trainee-dashboard-page.trainee-survey-page .trainee-survey-option:has(input[type="radio"]:checked) .indicator {
  border-color: #98a2b3;
}
body.trainee-dashboard-page.trainee-survey-page .trainee-survey-option:has(input[type="radio"]:checked) .indicator::before {
  background: var(--trainee-green);
}

/* =========================================
   Login "تذكرني" checkbox — matches the admin board
   active control (.admin-entry-control--checkbox)
   ========================================= */
.auth-card .remember-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.auth-card .remember-check__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.auth-card .remember-check__box {
  width: 24px;
  height: 24px;
  border: 1px solid #6c737f;
  border-radius: 2px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.auth-card .remember-check__box i {
  font-size: 16px;
  line-height: 1;
  opacity: 0;
}

.auth-card .remember-check__input:checked + .remember-check__box {
  border-color: #1b8354;
  background: #1b8354;
}

.auth-card .remember-check__input:checked + .remember-check__box i {
  opacity: 1;
}

.auth-card .remember-check__input:focus-visible + .remember-check__box {
  outline: 2px solid #1b8354;
  outline-offset: 2px;
}

.auth-card .remember-check__label {
  color: #1f2a37;
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
}
