/* ============================================================
   EduTrip - Components
   ============================================================ */

/* ========== STEPS BAR ========== */
.steps-bar {
  display: flex; gap: 0; margin-bottom: 28px;
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.step-item {
  flex: 1; padding: 14px 8px; text-align: center;
  border-left: 1px solid var(--border); cursor: pointer;
  transition: all 0.2s; position: relative;
}
.step-item:last-child { border-left: none; }
.step-item.active { background: var(--primary); color: white; }
.step-item.done { background: #e8f5e9; color: var(--success); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.2); font-size: 13px; font-weight: 700;
  margin-bottom: 4px;
}
.step-item.active .step-num { background: var(--gold); color: var(--primary); }
.step-item.done .step-num { background: var(--success); color: white; }
.step-label { font-size: 12px; font-weight: 600; display: block; }

/* ========== CARD ========== */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; margin-bottom: 20px;
}
.card-title {
  font-size: 18px; font-weight: 700; color: var(--primary);
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-title .icon { font-size: 22px; }

/* ========== FORM ========== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media(max-width:600px) { .form-grid { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 14px; font-weight: 600; color: var(--text); }
label span.req { color: var(--danger); margin-right: 3px; }
select, input:not([type]), input[type="date"], input[type="number"], input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="tel"], input[type="search"], textarea, #discover-keyword {
  padding: 12px 16px; border: 2px solid var(--border);
  border-radius: 10px; font-family: 'Cairo', sans-serif;
  font-size: 14px; color: var(--text); background: white;
  transition: border-color 0.2s; width: 100%; direction: rtl;
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6a80' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
}
select:focus, input:focus, textarea:focus {
  border-color: var(--primary-light); outline: none;
  box-shadow: 0 0 0 3px rgba(36,86,164,0.15);
}
select:disabled { background: var(--bg); cursor: not-allowed; }
input[type="file"] { padding: 8px; cursor: pointer; }
input[type="file"]::file-selector-button {
  border: 0; border-radius: 7px; padding: 7px 11px; margin-left: 10px;
  font-family: 'Cairo', sans-serif; font-weight: 700;
  color: var(--primary); background: #edf3fb; cursor: pointer;
}

/* ========== WEEKS SELECTOR ========== */
.weeks-selector { display: flex; align-items: center; gap: 16px; }
.weeks-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 2px solid var(--border);
  background: white; font-size: 20px; cursor: pointer; color: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-weight: 700;
}
.weeks-btn:hover { border-color: var(--primary-light); background: #eef2ff; }
.weeks-display {
  flex: 1; text-align: center; font-size: 24px; font-weight: 900;
  color: var(--primary);
}
.weeks-display span { font-size: 13px; font-weight: 600; color: var(--text-light); display: block; }

/* ========== TOGGLES ========== */
.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.toggle-card {
  border: 2px solid var(--border); border-radius: 12px; padding: 14px;
  cursor: pointer; transition: all 0.2s; position: relative;
  display: flex; align-items: flex-start; gap: 10px; user-select: none;
}
.toggle-card:hover { border-color: var(--primary-light); }
.toggle-card.active { border-color: var(--primary-light); background: #eef4ff; }
.toggle-card.disabled { opacity: 0.4; cursor: not-allowed; }
.toggle-icon { font-size: 24px; }
.toggle-info { flex: 1; }
.toggle-name { font-size: 13px; font-weight: 700; color: var(--text); }
.toggle-price { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.toggle-check {
  width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--border);
  background: white; position: absolute; top: 10px; left: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.toggle-card.active .toggle-check { background: var(--primary-light); border-color: var(--primary-light); }
.toggle-card.active .toggle-check::after { content: '✓'; color: white; font-size: 12px; font-weight: 900; }

:is(#split-housing-wrap, #second-program-wrap) .calculator-option-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f4f8ff;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}
:is(#split-housing-wrap, #second-program-wrap) .calculator-option-switch:hover { border-color: var(--primary-light); }
.calculator-option-switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  opacity: 0;
}
.calculator-option-switch-track {
  position: relative;
  flex: 0 0 44px;
  height: 24px;
  border-radius: 999px;
  background: #66768d;
}
.calculator-option-switch-track::before {
  content: '';
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}
.calculator-option-switch input:checked + .calculator-option-switch-track { background: var(--primary-light); }
.calculator-option-switch input:checked + .calculator-option-switch-track::before { inset-inline-start: 24px; }
.calculator-option-switch input:focus-visible + .calculator-option-switch-track {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ========== HOUSING ========== */
.housing-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
@media(max-width:600px) { .housing-options { grid-template-columns: 1fr; } }
.housing-card {
  border: 2px solid var(--border); border-radius: 16px; padding: 20px 16px 16px;
  cursor: pointer; transition: all 0.2s; text-align: center;
  display: flex; flex-direction: column; min-width: 0; gap: 10px;
}
.housing-card:hover { border-color: var(--primary-light); }
.housing-card.active { border-color: var(--primary-light); background: #eef4ff; }
.housing-card.disabled { opacity: 0.4; cursor: not-allowed; }
.housing-icon { font-size: 28px; line-height: 1.4; }
.housing-name { font-size: 15px; font-weight: 800; color: var(--primary); line-height: 1.7; overflow-wrap: anywhere; }
.housing-details { list-style: none; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 14px; margin: 4px 0 14px; padding: 0; text-align: right; direction: rtl; }
.housing-details li { position: relative; padding-inline-start: 12px; color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.8; overflow-wrap: anywhere; }
.housing-details li::before { content: ''; position: absolute; inset-inline-start: 0; top: .75em; width: 5px; height: 5px; border-radius: 50%; background: var(--primary-light); }
.housing-details-spacer { flex: 1; }
.housing-price { font-size: 13px; font-weight: 700; color: var(--primary-light); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); line-height: 1.8; }

/* ========== COURSE TYPE RADIO ========== */
.course-type-options { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-card {
  flex: 1; min-width: 140px; border: 2px solid var(--border); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.radio-card:hover { border-color: var(--primary-light); }
.radio-card.active { border-color: var(--primary-light); background: #eef4ff; }
.radio-card.disabled { opacity: 0.4; cursor: not-allowed; }
.radio-name { font-size: 13px; font-weight: 700; }
.radio-desc { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ========== SUMMARY TABLE ========== */
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table tr td { padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--border); }
.summary-table tr:last-child td { border-bottom: none; }
.summary-table .label { color: var(--text-light); }
.summary-table .value { text-align: left; font-weight: 600; color: var(--text); }
/* Only program-information descriptions have their own layout; cost columns stay automatic. */
#summary-table .study-phase-content { display: grid; grid-template-columns: 20% minmax(0, 1fr); align-items: center; gap: 12px; }
#summary-table .study-phase-row .value { min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
@media (min-width: 1200px) {
  #summary-table .study-phase-content { grid-template-columns: 16% minmax(0, 1fr); }
  #summary-table .study-phase-row .value { white-space: nowrap; font-size: 12.5px; }
}
@media (max-width: 600px) {
  #summary-table .study-phase-content { grid-template-columns: 25% minmax(0, 1fr); gap: 8px; }
  #summary-table .study-phase-row .value { white-space: normal; font-size: 12px; }
}
.summary-table .section-header td {
  background: var(--bg); font-weight: 700; color: var(--primary);
  font-size: 13px; padding: 8px 14px;
}
.total-row td { background: var(--primary); color: white !important; font-size: 16px !important; font-weight: 900 !important; }
.total-row .label, .total-row .value { color: white !important; }
.total-sar td { background: var(--gold); color: var(--primary) !important; font-size: 18px !important; font-weight: 900 !important; }
.total-sar .label, .total-sar .value { color: var(--primary) !important; }

/* ========== RESULT BOX ========== */
.result-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius); padding: 28px; color: white; text-align: center;
  margin-bottom: 20px;
}
.result-currency { font-size: 14px; opacity: 0.8; margin-bottom: 4px; }
.result-amount { font-size: 48px; font-weight: 900; line-height: 1; }
.result-unit { font-size: 16px; opacity: 0.7; margin-top: 4px; }
.result-sar { margin-top: 14px; background: rgba(212,168,67,0.2); border-radius: 10px; padding: 12px; }
.result-sar .label { font-size: 13px; opacity: 0.8; }
.result-sar .amount { font-size: 24px; font-weight: 900; color: var(--gold-light); }

/* ========== BUTTONS ========== */
.btn {
  padding: 14px 28px; border-radius: 12px; border: none; cursor: pointer;
  font-family: 'Cairo', sans-serif; font-size: 15px; font-weight: 700;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--primary-light); color: white; box-shadow: 0 4px 14px rgba(36,86,164,0.3); }
.btn-primary:hover { background: var(--primary); transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--primary); box-shadow: 0 4px 14px rgba(212,168,67,0.3); }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-outline { background: white; color: var(--primary-light); border: 2px solid var(--primary-light); }
.btn-outline:hover { background: #eef4ff; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 8px 16px; border-radius: 8px; font-size: 13px; }
.btn-actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 20px; }

/* ========== ALERT ========== */
.alert {
  padding: 14px 18px; border-radius: 10px; margin-bottom: 16px;
  font-size: 14px; display: flex; align-items: center; gap: 10px;
}
.alert-warning { background: #fef9ec; border: 1px solid #f5c97a; color: #854d0e; }
.alert-info { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

/* ========== SECTION DIVIDER ========== */
.section-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; }
.section-divider span { font-size: 13px; font-weight: 700; color: var(--text-light); white-space: nowrap; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ========== BADGES ========== */
.badge { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-pending { background: #fef9ec; color: #854d0e; border: 1px solid #f5c97a; }
.badge-stage1 { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }
.badge-stage2 { background: #f0f4ff; color: #4338ca; border: 1px solid #a5b4fc; }
.badge-stage3 { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.badge-stage4 { background: #e8f5e9; color: #1b5e20; border: 1px solid #86efac; }
.badge-role-admin { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-role-consultant { background: #eef4ff; color: var(--primary-light); border: 1px solid #93c5fd; }

/* ========== REQUEST CARDS ========== */
.req-card {
  background: white; border-radius: 14px; box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px; border-inline-start: 5px solid var(--gold);
}
.req-card.done { border-inline-start-color: var(--success); }
.req-card.visa-issued { background: #f5fcf6; border-color: #b8e6c2; }
.req-card-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.req-card-title { font-weight: 800; color: var(--primary); font-size: 15px; }
.req-card-sub { font-size: 12px; color: var(--text-light); margin-top: 3px; }
.req-mini-table { width: 100%; font-size: 13px; border-collapse: collapse; margin: 10px 0; }
.req-mini-table td { padding: 5px 8px; border-bottom: 1px dashed var(--border); }
.req-mini-table td:first-child { color: var(--text-light); width: 40%; }
.req-mini-table td:last-child { font-weight: 700; text-align: left; }
.req-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.status-select {
  padding: 8px 12px; border: 2px solid var(--border); border-radius: 8px;
  font-family: 'Cairo', sans-serif; font-size: 13px;
}
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

/* ========== USER ROW ========== */
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px; margin-bottom: 10px;
}
.user-row-info { display: flex; align-items: center; gap: 10px; }
.user-row-name { font-weight: 700; font-size: 14px; }
.user-row-uname { font-size: 12px; color: var(--text-light); }

/* ========== LOGIN ========== */
.login-wrap { max-width: 400px; margin: 60px auto; }
.login-wrap .form-group { margin-bottom: 16px; }

/* ========== VISUAL REFINEMENT ========== */
.steps-bar { border: 1px solid rgba(26,58,107,.09); box-shadow: 0 12px 30px rgba(26,58,107,.10); }
.step-item { padding: 17px 10px; }
.step-item.active { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.step-item.done { background: linear-gradient(135deg, #effaf2, #e5f5e9); }
.card {
  border: 1px solid rgba(26,58,107,.08);
  box-shadow: 0 12px 32px rgba(26,58,107,.08);
  padding: 30px;
  transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover { box-shadow: 0 16px 38px rgba(26,58,107,.11); }
.card-title { position: relative; border-bottom: 1px solid var(--border); }
.card-title::after {
  content: ''; position: absolute; bottom: -2px; right: 0;
  width: 66px; height: 3px; border-radius: 4px; background: var(--gold);
}
select, input[type="date"], input[type="number"], input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="file"] {
  min-height: 48px; border-color: #d9e2ef; background-color: #fcfdff;
}
select:hover, input:hover { border-color: #a9bbd4; }
.radio-card, .housing-card, .toggle-card { border-color: #dce5f0; background: #fff; }
.radio-card:hover, .housing-card:hover, .toggle-card:hover {
  transform: translateY(-2px); box-shadow: 0 8px 18px rgba(26,58,107,.09);
}
.radio-card.active, .housing-card.active, .toggle-card.active { box-shadow: 0 8px 18px rgba(36,86,164,.12); }
.weeks-selector { background: #f7faff; padding: 7px; border-radius: 13px; border: 1px solid #e0e8f2; }
.weeks-btn { background: #fff; box-shadow: 0 2px 7px rgba(26,58,107,.06); }
.result-box { box-shadow: 0 18px 40px rgba(26,58,107,.22); position: relative; overflow: hidden; }
.result-box::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.07); top: -145px; left: -55px; }
.result-box > * { position: relative; z-index: 1; }
.btn { min-height: 46px; justify-content: center; }
.btn:active { transform: translateY(1px); }
.summary-table { overflow: hidden; border: 1px solid #e1e8f1; border-radius: 12px; }
.summary-table thead th { background: #eef4fb; color: var(--primary); padding: 12px 14px; font-size: 13px; text-align: right; }
.summary-table tr td { padding: 12px 14px; }
.summary-table tr:not(.section-header):not(.total-row):not(.total-sar):hover td { background: #fafcff; }
.req-card { border: 1px solid #e0e8f1; border-inline-start: 5px solid var(--gold); box-shadow: 0 8px 22px rgba(26,58,107,.07); }
.req-card:hover { box-shadow: 0 12px 28px rgba(26,58,107,.11); }
.req-actions { padding-top: 12px; border-top: 1px solid #edf1f6; }
.user-row { border-color: #e0e8f1; padding: 15px 17px; transition: .2s; }
.user-row:hover { border-color: #b7c9e2; background: #fbfdff; }
.empty-state { background: #fbfdff; border: 1px dashed #c9d6e6; border-radius: 14px; }

/* ========== MOBILE ========== */
@media(max-width:700px) {
  .main { padding: 22px 12px 48px; }
  .card { padding: 21px 17px; border-radius: 14px; }
  .steps-bar { margin-bottom: 20px; }
  .step-item { padding: 12px 5px; }
  .step-label { font-size: 11px; }
  .result-amount { font-size: 38px; }
  .btn-actions { flex-direction: column; }
  .btn-actions > .btn,
  .btn-actions > div,
  .btn-actions > div .btn { width: 100%; }
  .summary-table tr td { padding: 10px 8px; font-size: 12px; }
}
