/* ============================================================
   Kurdish Language Community Survey -- Prototype Stylesheet
   ============================================================ */

:root {
  --clr-primary:        #2A6049;
  --clr-primary-dark:   #1e4534;
  --clr-primary-light:  #4A8B7B;
  --clr-primary-xlight: #E8F5F0;
  --clr-bg:             #FAFAF8;
  --clr-surface:        #FFFFFF;
  --clr-text:           #1A1A1A;
  --clr-muted:          #6B7280;
  --clr-border:         #E5E7EB;
  --clr-sens-bg:        #FEF3EE;
  --clr-sens-border:    #C85A0A;
  --clr-sens-icon:      #9A3E00;
  --radius:             10px;
  --shadow:             0 2px 10px rgba(0,0,0,0.07);
}

/* --- Bootstrap primary override ----------------------------- */
:root {
  --bs-primary:        #2A6049;
  --bs-primary-rgb:    42, 96, 73;
  --bs-link-color:     #2A6049;
  --bs-link-hover-color: #1e4534;
}

.btn-primary {
  --bs-btn-color:              #fff;
  --bs-btn-bg:                 #2A6049;
  --bs-btn-border-color:       #2A6049;
  --bs-btn-hover-color:        #fff;
  --bs-btn-hover-bg:           #214d3a;
  --bs-btn-hover-border-color: #1e4534;
  --bs-btn-focus-shadow-rgb:   42, 96, 73;
  --bs-btn-active-color:       #fff;
  --bs-btn-active-bg:          #1e4534;
  --bs-btn-active-border-color:#1e4534;
  --bs-btn-disabled-bg:        #2A6049;
  --bs-btn-disabled-border-color: #2A6049;
}

.btn-outline-primary {
  --bs-btn-color:              #2A6049;
  --bs-btn-border-color:       #2A6049;
  --bs-btn-hover-color:        #fff;
  --bs-btn-hover-bg:           #2A6049;
  --bs-btn-hover-border-color: #2A6049;
  --bs-btn-active-color:       #fff;
  --bs-btn-active-bg:          #2A6049;
}

/* --- Base layout -------------------------------------------- */
body {
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* --- Navbar -------------------------------------------------- */
.navbar-green {
  background-color: var(--clr-primary) !important;
}

.navbar-green .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* --- Footer -------------------------------------------------- */
.footer {
  background-color: #1e3329;
  color: #cdd9d5;
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.875rem;
}

.footer a { color: #9dc4b8; }
.footer a:hover { color: #fff; }

/* --- Hero (landing page) ------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-light) 100%);
  color: #fff;
  padding: 4rem 0 3rem;
}

.hero h1 { font-weight: 800; font-size: 2.4rem; }
.hero .lead { font-size: 1.15rem; opacity: 0.92; }

.feature-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: 100%;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.feature-card .icon {
  font-size: 2rem;
  color: var(--clr-primary);
  margin-bottom: 0.75rem;
}

/* --- Survey container --------------------------------------- */
.survey-container {
  max-width: 820px;
  margin: 0 auto;
}

/* --- Progress indicator ------------------------------------- */
#survey-progress {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.step-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--clr-border);
  background: #fff;
  color: var(--clr-muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.step-dot.active {
  border-color: var(--clr-primary);
  background: var(--clr-primary);
  color: #fff;
}

.step-dot.completed {
  border-color: var(--clr-primary-light);
  background: var(--clr-primary-xlight);
  color: var(--clr-primary);
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--clr-border);
  border-radius: 1px;
}

.step-connector.completed {
  background: var(--clr-primary-light);
}

#step-label {
  font-size: 0.85rem;
  color: var(--clr-muted);
  font-weight: 500;
}

/* --- Survey step card --------------------------------------- */
.survey-step-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.step-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--clr-primary-dark);
  margin-bottom: 0.25rem;
}

.step-subheading {
  color: var(--clr-muted);
  font-size: 0.92rem;
  margin-bottom: 1.75rem;
}

/* --- Question blocks ---------------------------------------- */
.question-block {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--clr-border);
}

.question-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.question-label {
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--clr-text);
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.optional-badge {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--clr-muted);
  background: #F3F4F6;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
}

/* --- Info tooltip ------------------------------------------- */
.info-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--clr-primary-light);
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.info-btn:hover { color: var(--clr-primary); }

.info-content {
  background: #F0FAF6;
  border-left: 3px solid var(--clr-primary-light);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 0.75rem 0;
  font-size: 0.875rem;
  color: #374151;
}

.info-content p:last-child { margin-bottom: 0; }

/* --- Sensitive field ---------------------------------------- */
.sensitive-field {
  background: var(--clr-sens-bg);
  border: 1px solid #f4c5a0;
  border-left: 4px solid var(--clr-sens-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.sensitive-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--clr-sens-icon);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.sensitive-header .bi {
  font-size: 1rem;
  flex-shrink: 0;
}

.sensitive-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--clr-sens-icon);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: auto;
}

.sensitive-toggle:hover { color: #7a2e00; }

.sensitive-detail {
  background: #fff8f5;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #5c2c00;
}

.sensitive-detail p:last-child { margin-bottom: 0; }

.sensitive-field .question-label {
  margin-top: 0.5rem;
}

/* --- Form controls ------------------------------------------ */
.form-control:focus, .form-select:focus {
  border-color: var(--clr-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(42, 96, 73, 0.2);
}

.form-check-input:checked {
  background-color: var(--clr-primary);
  border-color: var(--clr-primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(42, 96, 73, 0.2);
}

textarea.form-control { min-height: 110px; }

textarea.form-control.tall { min-height: 160px; }

/* --- Use-contexts matrix table ------------------------------ */
.use-contexts-table {
  font-size: 0.88rem;
}

.use-contexts-table thead th {
  background: var(--clr-primary-xlight);
  color: var(--clr-primary-dark);
  font-weight: 600;
  font-size: 0.82rem;
  text-align: center;
  border-color: #cde3db;
  vertical-align: middle;
}

.use-contexts-table tbody td {
  vertical-align: middle;
  border-color: var(--clr-border);
}

.use-contexts-table tbody td:first-child {
  font-weight: 500;
  width: 30%;
}

.use-contexts-table tbody td:not(:first-child) {
  text-align: center;
}

.use-contexts-table tbody tr:hover {
  background: #F9FAFB;
}

/* --- Interactive Map ---------------------------------------- */
.map-section {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.map-header {
  background: var(--clr-primary-xlight);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #cde3db;
  font-size: 0.85rem;
  color: var(--clr-primary-dark);
}

#language-map {
  height: 400px;
  width: 100%;
}

.map-sidebar {
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-top: 1px solid var(--clr-border);
  min-height: 80px;
}

.map-sidebar-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* --- Navigation buttons ------------------------------------- */
#nav-buttons {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
}

/* --- Consent screen ----------------------------------------- */
.consent-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 0 auto;
}

.consent-checklist {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
}

.consent-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: 0.95rem;
}

.consent-checklist .bi {
  color: var(--clr-primary);
  margin-top: 0.15rem;
  flex-shrink: 0;
  font-size: 1.05rem;
}

/* --- Key question highlight --------------------------------- */
.key-question .question-label {
  color: var(--clr-primary-dark);
  font-size: 1.05rem;
}

.key-question textarea {
  min-height: 180px;
  border-color: var(--clr-primary-light);
}

.key-question-badge {
  font-size: 0.72rem;
  background: var(--clr-primary);
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* --- Thank you page ----------------------------------------- */
.thankyou-icon {
  font-size: 4rem;
  color: var(--clr-primary);
}

/* --- Admin view --------------------------------------------- */
.admin-response {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.admin-response-header {
  background: var(--clr-primary-xlight);
  padding: 0.6rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-primary-dark);
  cursor: pointer;
}

.admin-response-body {
  padding: 1rem;
  font-size: 0.85rem;
}

.admin-field {
  display: flex;
  gap: 0.75rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.admin-field:last-child { border-bottom: none; }

.admin-field-name {
  font-weight: 600;
  color: var(--clr-muted);
  flex: 0 0 220px;
  font-size: 0.8rem;
}

.admin-field-value {
  color: var(--clr-text);
  word-break: break-word;
}

.admin-field-value.empty { color: #D1D5DB; font-style: italic; }

/* --- Utility ------------------------------------------------ */
.text-primary-custom { color: var(--clr-primary) !important; }

.bg-primary-xlight { background: var(--clr-primary-xlight) !important; }

.section-divider {
  border: none;
  border-top: 2px solid var(--clr-border);
  margin: 2rem 0;
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 576px) {
  .survey-step-card { padding: 1.25rem; }
  .consent-card { padding: 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
  #language-map { height: 280px; }
  .use-contexts-table { font-size: 0.78rem; }
  .admin-field { flex-direction: column; gap: 0.2rem; }
  .admin-field-name { flex: none; }
}
