/**
 * Sohar Operation Services (SOS) - Careers & Training Application Stylesheet
 * Fully responsive, accessible, dark/light theme compatible, matching official brand guidelines.
 */

/* ==========================================================================
   1. TRAINING SECTION CONTAINER & AMBIENCE
   ========================================================================== */
.sos-careers-training-section {
  margin-top: 5rem;
  padding-top: 4.5rem;
  border-top: 1px solid var(--card-border);
  position: relative;
  scroll-margin-top: 100px;
}

.sos-training-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 3.5rem;
}

.sos-training-dest-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(55, 176, 229, 0.1);
  border: 1px solid rgba(55, 176, 229, 0.3);
  padding: 0.45rem 1.25rem;
  border-radius: 9999px;
  margin-top: 1.25rem;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.sos-training-dest-pill:hover {
  background: rgba(55, 176, 229, 0.16);
  border-color: var(--color-brand-cyan);
  transform: translateY(-1px);
}

.sos-training-dest-pill__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseGreenDot 2s infinite;
}

@keyframes pulseGreenDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.3); }
}

.sos-training-dest-pill__text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-brand-cyan);
  letter-spacing: 0.25px;
}

.sos-training-dest-pill__email {
  font-family: monospace;
  font-weight: 800;
  color: #ffffff;
  background: rgba(48, 49, 142, 0.6);
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .sos-training-dest-pill__email {
  color: #ffffff;
  background: var(--color-brand-navy);
}

/* ==========================================================================
   2. TRAINING PROGRAM TRACK CARDS (Overview Grid)
   ========================================================================== */
.sos-training-tracks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

@media (max-width: 992px) {
  .sos-training-tracks-grid {
    grid-template-columns: 1fr;
  }
}

.sos-training-track-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  box-shadow: var(--shadow-md);
}

.sos-training-track-card:hover {
  transform: translateY(-6px);
  border-color: rgba(55, 176, 229, 0.45);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.35), 0 0 20px rgba(55, 176, 229, 0.15);
}

.sos-training-track-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-brand-cyan), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.sos-training-track-card:hover::before {
  opacity: 1;
}

.sos-training-track-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(55, 176, 229, 0.12);
  color: var(--color-brand-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(55, 176, 229, 0.25);
  transition: all 0.3s ease;
}

.sos-training-track-card:hover .sos-training-track-icon {
  background: var(--color-brand-cyan);
  color: #ffffff;
  transform: scale(1.08) rotate(-4deg);
}

.sos-training-track-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-brand-cyan);
  background: rgba(55, 176, 229, 0.08);
  border: 1px solid rgba(55, 176, 229, 0.2);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.sos-training-track-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.sos-training-track-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex: 1;
}

.sos-training-track-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px dashed var(--card-border);
}

/* ==========================================================================
   3. TRAINING APPLICATION & CV SUBMISSION FORM CARD
   ========================================================================== */
.sos-training-form-wrapper {
  max-width: 960px;
  margin: 0 auto;
}

.sos-training-card {
  background: var(--card-bg);
  border: 1.5px solid rgba(55, 176, 229, 0.25);
  border-radius: 28px;
  padding: 3rem 2.75rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 0 35px rgba(48, 49, 142, 0.2);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .sos-training-card {
  border-color: rgba(30, 102, 176, 0.2);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.1), 0 0 25px rgba(55, 176, 229, 0.08);
}

/* Top Glow Edge */
.sos-training-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-brand-cyan), var(--color-brand-blue), transparent);
}

.sos-training-form-hero {
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 2rem;
  margin-bottom: 2.25rem;
}

.sos-training-form-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(48, 49, 142, 0.2), rgba(55, 176, 229, 0.15));
  border: 1px solid rgba(55, 176, 229, 0.3);
  color: var(--color-brand-cyan);
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.sos-training-form-title {
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

.sos-training-form-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 800px;
  margin: 0;
}

/* Section Header Dividers */
.sos-form-section-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 2.25rem 0 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--card-border);
}

.sos-section-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-brand-navy);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid var(--color-brand-cyan);
  flex-shrink: 0;
}

.sos-form-section-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0;
}

/* Form Grid Rows */
.sos-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.sos-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .sos-form-grid-2,
  .sos-form-grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sos-training-card {
    padding: 2rem 1.25rem;
  }

  .sos-luxury-select,
  .sos-training-form input,
  .sos-training-form select,
  .sos-training-form textarea {
    font-size: 16px !important;
  }
}

/* Custom Select Styling */
.sos-luxury-select {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.25s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2337B0E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  cursor: pointer;
}

html[dir="rtl"] .sos-luxury-select {
  background-position: left 1rem center;
  padding-left: 2.5rem;
}

html[dir="ltr"] .sos-luxury-select {
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.sos-luxury-select:hover {
  border-color: rgba(55, 176, 229, 0.4);
}

.sos-luxury-select:focus {
  outline: none;
  border-color: var(--color-brand-cyan);
  box-shadow: 0 0 0 3px rgba(55, 176, 229, 0.18);
}

/* ==========================================================================
   4. CV & DOCUMENT DROPZONES
   ========================================================================== */
.sos-cv-dropzone {
  border: 2px dashed rgba(55, 176, 229, 0.35);
  background: rgba(55, 176, 229, 0.03);
  border-radius: 18px;
  padding: 2.25rem 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.sos-cv-dropzone:hover,
.sos-cv-dropzone.is-dragover {
  border-color: var(--color-brand-cyan);
  background: rgba(55, 176, 229, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(55, 176, 229, 0.15);
}

.sos-cv-dropzone__icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(55, 176, 229, 0.12);
  color: var(--color-brand-cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 1px solid rgba(55, 176, 229, 0.25);
  transition: transform 0.3s ease;
}

.sos-cv-dropzone:hover .sos-cv-dropzone__icon {
  transform: scale(1.1) translateY(-3px);
  background: var(--color-brand-cyan);
  color: #ffffff;
}

.sos-cv-dropzone__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.35rem;
}

.sos-cv-dropzone__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.15rem;
}

.sos-cv-btn-browse {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.35rem;
  background: var(--color-brand-navy);
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid rgba(55, 176, 229, 0.4);
  box-shadow: 0 4px 12px rgba(48, 49, 142, 0.3);
  transition: all 0.25s ease;
}

.sos-cv-btn-browse:hover {
  background: var(--color-brand-blue);
  border-color: var(--color-brand-cyan);
  transform: translateY(-1px);
}

/* File Preview State */
.sos-file-preview-card {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  animation: fadeInFile 0.3s ease;
}

.sos-file-preview-card.is-active {
  display: flex;
}

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

.sos-file-preview-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
}

.sos-file-badge {
  padding: 0.35rem 0.65rem;
  background: #10b981;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sos-file-badge.badge-doc {
  background: #2563eb;
}

.sos-file-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.sos-file-size {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sos-file-remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sos-file-remove-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  transform: scale(1.15);
}

/* ==========================================================================
   5. DECLARATION & SUBMISSION CONTROLS
   ========================================================================== */
.sos-declaration-box {
  background: rgba(55, 176, 229, 0.05);
  border: 1px solid rgba(55, 176, 229, 0.18);
  border-radius: 14px;
  padding: 1.15rem 1.35rem;
  margin: 2rem 0 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.sos-declaration-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--color-brand-cyan);
  cursor: pointer;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.sos-declaration-label {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.sos-training-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.sos-btn-submit-training {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.1rem 2rem;
  background: linear-gradient(135deg, var(--color-brand-navy) 0%, var(--color-brand-blue) 50%, var(--color-brand-cyan) 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(48, 49, 142, 0.35), 0 0 20px rgba(55, 176, 229, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.sos-btn-submit-training:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(48, 49, 142, 0.45), 0 0 30px rgba(55, 176, 229, 0.4);
}

.sos-btn-submit-training:active {
  transform: translateY(0);
}

.sos-btn-submit-training:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.sos-btn-mailto-fallback {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-heading);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
}

.sos-btn-mailto-fallback:hover {
  background: rgba(55, 176, 229, 0.1);
  border-color: var(--color-brand-cyan);
  color: var(--color-brand-cyan);
}

/* ==========================================================================
   6. CONFIRMATION MODAL & RECEIPT
   ========================================================================== */
.sos-training-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 18, 35, 0.88);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.sos-training-modal-overlay.is-visible {
  display: flex;
  opacity: 1;
}

.sos-training-modal {
  max-width: 620px;
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid rgba(55, 176, 229, 0.4);
  border-radius: 26px;
  padding: 2.75rem 2.25rem;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 50px rgba(55, 176, 229, 0.25);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.sos-training-modal-overlay.is-visible .sos-training-modal {
  transform: scale(1);
}

.sos-training-modal-summary {
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: start;
}

.sos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.sos-summary-row:last-child {
  border-bottom: none;
}

.sos-summary-label {
  color: var(--text-muted);
  font-weight: 500;
}

.sos-summary-val {
  color: var(--text-heading);
  font-weight: 700;
}

/* ==========================================================================
   7. PRINT RECEIPT MEDIA STYLES
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  .sos-training-modal,
  .sos-training-modal * {
    visibility: visible;
  }
  .sos-training-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    border: none;
    box-shadow: none;
    color: #000000 !important;
  }
  .sos-training-modal-overlay {
    background: #ffffff !important;
    position: static;
    display: block !important;
    opacity: 1 !important;
  }
  .sos-success-actions {
    display: none !important;
  }
}
