/* =============================================================
   Survey - بانر + Modal (v6.29)
   ألوان الهوية: #1F4E79 (أزرق داكن) · #2E75B6 (أزرق متوسط)
   ============================================================= */

/* ======= البانر العلوي ======= */
#surveyBanner {
  display: none;
  background: linear-gradient(90deg, #1F4E79, #2E75B6);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 900;
  min-height: 48px;
  box-shadow: 0 2px 8px rgba(31, 78, 121, 0.3);
}
.sb-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 10px;
}
.sb-message {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
}
.sb-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sb-btn-primary {
  background: #fff;
  color: #1F4E79;
  border: none;
  padding: 7px 14px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.sb-btn-primary:hover { background: #f0f6fb; }
.sb-btn-later {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
  padding: 6px 12px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.sb-btn-later:hover { background: rgba(255,255,255,0.15); }
.sb-btn-close {
  background: transparent;
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.85;
  font-family: inherit;
}
.sb-btn-close:hover { opacity: 1; background: rgba(255,255,255,0.15); }

@media (min-width: 768px) {
  #surveyBanner { min-height: 56px; }
  .sb-message { font-size: 14px; }
  .sb-btn-primary { font-size: 13.5px; padding: 8px 18px; }
}

/* ======= Modal الاستبيان ======= */
#surveyModal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sq-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.sq-content {
  position: relative;
  background: #fff;
  width: 100%;
  height: 100%;
  max-width: 480px;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sqSlideUp 0.3s ease-out;
  z-index: 1;
}
@keyframes sqSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 600px) {
  .sq-content {
    height: auto;
    max-height: 90vh;
    border-radius: 16px;
    margin: 16px;
  }
}

/* رأس الـ Modal */
.sq-header {
  padding: 12px 14px 14px;
  background: linear-gradient(135deg, #1F4E79, #2E75B6);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}
.sq-close {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  font-family: inherit;
}
.sq-close:hover { background: rgba(255,255,255,0.35); }
.sq-progress-wrap {
  margin-top: 8px;
}
.sq-progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.25);
  border-radius: 8px;
  overflow: hidden;
}
.sq-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 8px;
  transition: width 0.4s ease;
  box-shadow: 0 0 6px rgba(255,255,255,0.5);
}
.sq-progress-text {
  font-size: 12px;
  margin-top: 6px;
  opacity: 0.95;
  text-align: center;
  font-weight: 600;
}

/* جسم السؤال */
.sq-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px;
}
.sq-question {
  font-size: 17px;
  font-weight: 800;
  color: #1F4E79;
  margin-bottom: 18px;
  line-height: 1.6;
  text-align: right;
}
.sq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sq-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7fbfd;
  border: 2px solid #e0e8f0;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 14px;
}
.sq-option:hover {
  background: #ecf4fa;
  border-color: #b8d0e4;
}
.sq-option.selected {
  background: #e8f2fa;
  border-color: #2E75B6;
  box-shadow: 0 2px 8px rgba(46,117,182,0.15);
}
.sq-option input[type="radio"],
.sq-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #2E75B6;
  cursor: pointer;
  flex-shrink: 0;
}
.sq-option-label {
  flex: 1;
  color: #2c3e50;
  font-weight: 600;
}
.sq-other-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  color: #2c3e50;
}

/* Textarea */
.sq-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 2px solid #e0e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: #2c3e50;
  resize: vertical;
  outline: none;
  background: #f7fbfd;
}
.sq-textarea:focus {
  border-color: #2E75B6;
  background: #fff;
}
.sq-optional-hint {
  font-size: 11.5px;
  color: #888;
  margin-top: 6px;
  text-align: center;
}

/* Scale (1-10) */
.sq-scale-wrap {
  background: #f7fbfd;
  border: 2px solid #e0e8f0;
  padding: 20px 16px;
  border-radius: 12px;
  text-align: center;
}
.sq-scale-value {
  font-size: 48px;
  font-weight: 900;
  color: #1F4E79;
  margin-bottom: 10px;
  line-height: 1;
}
.sq-scale {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e74c3c 0%, #f39c12 50%, #27ae60 100%);
  outline: none;
  cursor: pointer;
}
.sq-scale::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #1F4E79;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.sq-scale::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #1F4E79;
  cursor: pointer;
}
.sq-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: #888;
  font-weight: 600;
}

/* Footer Buttons */
.sq-footer {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #eef0f5;
  flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}
.sq-btn-prev,
.sq-btn-next,
.sq-btn-submit {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.18s ease;
  min-height: 44px;
}
.sq-btn-prev {
  background: #f0f1f5;
  color: #555;
}
.sq-btn-prev:hover:not(:disabled) { background: #e0e2e8; }
.sq-btn-prev:disabled { opacity: 0.4; cursor: not-allowed; }
.sq-btn-next {
  background: linear-gradient(135deg, #1F4E79, #2E75B6);
  color: #fff;
  box-shadow: 0 3px 10px rgba(31, 78, 121, 0.3);
}
.sq-btn-next:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(31, 78, 121, 0.45); }
.sq-btn-next:disabled { background: #c5c5c5; cursor: not-allowed; box-shadow: none; }
.sq-btn-submit {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
  box-shadow: 0 3px 10px rgba(39, 174, 96, 0.35);
}
.sq-btn-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(39, 174, 96, 0.5); }
.sq-btn-submit:disabled { background: #c5c5c5; cursor: not-allowed; box-shadow: none; }

/* شاشة الشكر */
.sq-thanks {
  padding: 40px 24px;
  text-align: center;
  justify-content: center;
}
.sq-thanks-emoji {
  font-size: 80px;
  margin-bottom: 16px;
  animation: heartBeat 1.2s ease-out;
}
@keyframes heartBeat {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
.sq-thanks-title {
  font-size: 24px;
  font-weight: 900;
  color: #1F4E79;
  margin-bottom: 10px;
}
.sq-thanks-text {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
}
