/* index.css */

/* Base reset and layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  background-color: #f1f3f5;
  color: #333333;
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.survey-wrapper {
  width: 100%;
  max-width: 820px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header styling */
.survey-header {
  padding: 15px 0 25px 0;
  text-align: center;
}

.header-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.logo-title {
  font-size: 20px;
  font-weight: 700;
  color: #004b73;
  letter-spacing: 0.5px;
}

.logo-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: #758a99;
  text-transform: uppercase;
  margin-top: 4px;
  letter-spacing: 1px;
}

/* Main Container Card */
.survey-container {
  background-color: #ffffff;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 40px 45px;
  margin-bottom: 25px;
}

/* Qualtrics top accent bar */
.survey-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background-color: #007ac0;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

/* Form layout */
#survey-form {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.survey-page {
  display: flex;
  flex-direction: column;
  gap: 35px;
  flex-grow: 1;
}

.survey-page.hidden {
  display: none;
}

/* Questions and Blocks */
.question-block {
  margin-bottom: 10px;
}

.question-text {
  font-size: 16px;
  font-weight: 600;
  color: #232b35;
  margin-bottom: 20px;
  position: relative;
}

.question-number {
  color: #8fa0ab;
  font-weight: 400;
  margin-right: 8px;
}

.welcome-text {
  font-size: 15px;
  color: #4a545e;
  background-color: #f7f9fa;
  border-left: 3px solid #007ac0;
  padding: 15px 20px;
  border-radius: 0 4px 4px 0;
}

.welcome-text p {
  margin-bottom: 10px;
}

.welcome-text p:last-child {
  margin-bottom: 0;
}

/* NPS Scale Component */
.nps-container {
  margin-top: 15px;
}

.nps-scale {
  display: flex;
  justify-content: space-between;
  border: 1px solid #d3dbe0;
  border-radius: 4px;
  overflow: hidden;
  background-color: #ffffff;
}

.nps-btn {
  flex: 1;
  background: none;
  border: none;
  border-right: 1px solid #d3dbe0;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 600;
  color: #4a545e;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  text-align: center;
}

.nps-btn:last-child {
  border-right: none;
}

.nps-btn:hover {
  background-color: #f0f4f7;
  color: #007ac0;
}

.nps-btn.selected {
  background-color: #007ac0;
  color: #ffffff;
}

.nps-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #758a99;
  font-weight: 600;
  padding: 0 4px;
}

/* Smoke 1-10 Scale Component (same visual style as NPS) */
.smoke-container {
  margin-top: 15px;
}

.smoke-scale {
  display: flex;
  justify-content: space-between;
  border: 1px solid #d3dbe0;
  border-radius: 4px;
  overflow: hidden;
  background-color: #ffffff;
}

.smoke-btn {
  flex: 1;
  background: none;
  border: none;
  border-right: 1px solid #d3dbe0;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 600;
  color: #4a545e;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  text-align: center;
}

.smoke-btn:last-child {
  border-right: none;
}

.smoke-btn:hover {
  background-color: #f0f4f7;
  color: #007ac0;
}

.smoke-btn.selected {
  background-color: #007ac0;
  color: #ffffff;
}

.smoke-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #758a99;
  font-weight: 600;
  padding: 0 4px;
}

/* Matrix Table Styling */
.matrix-wrapper {
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid #d3dbe0;
  border-radius: 4px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 13px;
}

.matrix-table th {
  background-color: #f7f9fa;
  color: #4a545e;
  font-weight: 600;
  padding: 12px 10px;
  border-bottom: 2px solid #d3dbe0;
  font-size: 12px;
}

.matrix-table th:first-child {
  text-align: left;
  width: 30%;
}

.matrix-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #eef2f5;
}

.matrix-table tr:nth-child(even) td {
  background-color: #fbfcfd;
}

.matrix-table tr:last-child td {
  border-bottom: none;
}

.row-label {
  text-align: left;
  font-weight: 600;
  color: #333333;
  font-size: 14px;
}

/* Radio buttons & Checkboxes inside Matrix */
.matrix-table input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #007ac0;
}

/* Checkbox & Radio lists (Vertical layouts) */
.checkbox-list, .radio-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.checkbox-item, .radio-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  border: 1px solid #d3dbe0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.checkbox-item:hover, .radio-item:hover {
  background-color: #f7f9fa;
  border-color: #bdc8d0;
}

/* Hide standard inputs for custom stylings */
.checkbox-item input, .radio-item input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-custom {
  height: 20px;
  width: 20px;
  background-color: #ffffff;
  border: 2px solid #a9b8c2;
  border-radius: 3px;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  margin-top: 2px;
}

.checkbox-item input:checked ~ .checkbox-custom {
  background-color: #007ac0;
  border-color: #007ac0;
}

.checkbox-custom:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-item input:checked ~ .checkbox-custom:after {
  display: block;
}

.radio-custom {
  height: 20px;
  width: 20px;
  background-color: #ffffff;
  border: 2px solid #a9b8c2;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  margin-top: 2px;
}

.radio-item input:checked ~ .radio-custom {
  background-color: #ffffff;
  border-color: #007ac0;
}

.radio-custom:after {
  content: "";
  position: absolute;
  display: none;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #007ac0;
}

.radio-item input:checked ~ .radio-custom:after {
  display: block;
}

.checkbox-label, .radio-label {
  font-size: 14.5px;
  color: #4a545e;
}

/* Highlight checked items */
.checkbox-item:has(input:checked), .radio-item:has(input:checked) {
  border-color: #007ac0;
  background-color: #f4f9fc;
}

/* Textareas */
.textarea-container {
  margin-top: 10px;
}

textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d3dbe0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease;
}

textarea:focus {
  border-color: #007ac0;
  box-shadow: 0 0 0 2px rgba(0, 122, 192, 0.15);
}

/* Navigation Buttons Group */
.survey-buttons {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid #eef2f5;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
}

.nav-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 42px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  outline: none;
}

.prev-btn {
  background-color: #e4ebf0;
  color: #4a545e;
}

.prev-btn:hover {
  background-color: #cbd7e0;
}

.next-btn {
  background-color: #007ac0;
  color: #ffffff;
}

.next-btn:hover {
  background-color: #005d93;
}

.next-btn:disabled {
  background-color: #c2dbe8;
  cursor: not-allowed;
}

.nav-btn.hidden {
  display: none;
}

.arrow {
  font-size: 20px;
  font-weight: bold;
}

/* Error Banner styling */
.error-banner {
  background-color: #fff0f0;
  border: 1px solid #f5c2c2;
  border-radius: 4px;
  padding: 12px 18px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-banner.hidden {
  display: none;
}

.error-icon {
  font-size: 18px;
}

.error-message {
  color: #d93025;
  font-size: 13.5px;
  font-weight: 600;
}

/* Success View */
.success-block {
  text-align: center;
  padding: 40px 0;
}

.success-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 60px;
  background-color: #e6f6ec;
  color: #24b47e;
  border-radius: 50%;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
}

.success-block h2 {
  font-size: 24px;
  color: #232b35;
  margin-bottom: 12px;
}

.success-block p {
  color: #5f7282;
  margin-bottom: 8px;
}

/* Footer & Progress bar */
.survey-footer {
  margin-top: auto;
  width: 100%;
}

.progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.progress-bar-outer {
  width: 150px;
  height: 8px;
  background-color: #e4ebf0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background-color: #007ac0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  font-size: 11px;
  color: #758a99;
  font-weight: 600;
  margin-top: 6px;
}

.qual-footer {
  font-size: 11px;
  color: #a4b4c0;
  text-align: center;
  border-top: 1px solid #e4ebf0;
  padding-top: 15px;
  letter-spacing: 0.5px;
}

/* Sortable / Ranking Question styles */
.ranking-container {
  margin-top: 15px;
  max-width: 500px;
}
.sortable-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sortable-item {
  display: flex;
  align-items: center;
  background-color: #fcfcfc;
  border: 1px solid #d3dbe0;
  border-radius: 4px;
  padding: 12px 15px;
  margin-bottom: 8px;
  cursor: grab;
  user-select: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.sortable-item:active {
  cursor: grabbing;
}
.sortable-item.dragging {
  opacity: 0.5;
  background-color: #f0f4f8;
  border-color: #007ac0;
}
.rank-number {
  background-color: #007ac0;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  margin-right: 15px;
}
.rank-text {
  flex-grow: 1;
  font-size: 15px;
  color: #232b35;
}
.drag-handle {
  color: #9aa7b3;
  font-size: 18px;
  margin-left: 10px;
}

/* Responsive adjustments */
@media(max-width: 600px) {
  .survey-container {
    padding: 25px 20px;
  }
  
  .nps-scale, .smoke-scale {
    flex-wrap: wrap;
    border: none;
  }
  
  .nps-btn, .smoke-btn {
    flex: none;
    width: 18%;
    border: 1px solid #d3dbe0;
    margin-bottom: 6px;
    border-radius: 4px;
    padding: 10px 0;
  }
  
  .nps-btn:last-child, .smoke-btn:last-child {
    border-right: 1px solid #d3dbe0;
  }

  .matrix-table {
    display: block;
    overflow-x: auto;
  }
}

/* Hoagie photo styling */
.hoagie-image-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.hoagie-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #007ac0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.hoagie-photo:hover {
  transform: scale(1.05);
}

