/* 1: Module: survey-theme.css
   2: Path: G:\My Drive\sapsaj.com\public\tools\surveys\survey-theme.css
   3: Inputs: Native CSS3
   4: Exports: none
   5: Purpose: Pure custom CSS replacing Tailwind with high-density, multi-language grid and dark theme */

:root {
  --bg-main: #0b0f19;
  --bg-card: #131d2e;
  --bg-card-sub: #0e1624;
  --bg-input: #080c14;
  --border-card: #223147;
  --border-subtle: #192438;
  --text-main: #f1f5f9;
  --text-muted: #8e9eb5;
  --accent-en: #10b981;
  --accent-es: #06b6d4;
  --accent-ar: #f59e0b;
  --accent-so: #a855f7;
  --accent-fr: #3b82f6;
  --accent-zh: #ef4444;
  --accent-ne: #f43f5e;
  --accent-vi: #84cc16;
  --accent-uk: #0ea5e9;
  --accent-ht: #f97316;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

/* Base typography vertical margins reduction */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 4px 0;
  line-height: 1.25;
}
p {
  margin: 0 0 4px 0;
  line-height: 1.3;
}
p:last-child {
  margin-bottom: 0;
}

/* Top App Navigation */
.survey-nav {
  background: rgba(19, 29, 46, 0.95);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(6px);
}

.survey-app {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 14px 40px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Section Container Cards */
.survey-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.survey-box-title {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.survey-box-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Header & Controls */
.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.header-text-block {
  flex: 1;
  min-width: 0;
}

.header-qr-container {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  background: #ffffff;
  padding: 3px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Dropdown Menu */
.lang-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.lang-dropdown-btn {
  background: #1e293b;
  border: 1px solid var(--border-card);
  color: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.lang-dropdown-btn:hover {
  background: #334155;
  border-color: var(--accent-en);
}

.lang-dropdown-panel {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  width: 220px;
  background: #101827;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
}

/* Language Cards & Borders */
.lang-box {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.25;
}

.border-l-solid { border-left: 3.5px solid var(--accent-en) !important; }
.border-l-dashed { border-left: 3.5px dashed var(--accent-es) !important; }
.border-l-dotted { border-left: 3.5px dotted var(--accent-ar) !important; }
.border-l-double { border-left: 4.5px double var(--accent-so) !important; }
.border-l-emerald-500 { border-left-color: var(--accent-en) !important; }
.border-l-cyan-500 { border-left-color: var(--accent-es) !important; }

/* Modular Multi-Column Grid */
.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.modular-lang-grid {
  display: grid;
  gap: 8px;
  width: 100%;
}
.modular-lang-grid.cols-1 {
  grid-template-columns: 1fr;
}
.modular-lang-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.modular-lang-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.modular-lang-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Mobile Legibility & Touch Optimization (mobile-legibility-mode) */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.5;
  }
  .survey-app {
    padding: 8px 10px 48px 10px;
    gap: 12px;
  }
  .survey-box {
    padding: 14px 14px;
    gap: 12px;
    border-radius: 12px;
  }
  .survey-box-title {
    font-size: 16px;
    letter-spacing: 0.25px;
  }
  .survey-box-subtitle {
    font-size: 14px;
    line-height: 1.4;
  }
  .modular-lang-grid.cols-2,
  .modular-lang-grid.cols-3,
  .modular-lang-grid.cols-4 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .options-2col-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .lang-box {
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.45;
    gap: 6px;
  }
  .option-row {
    padding: 8px 8px;
    font-size: 15px;
    min-height: 40px;
    align-items: center;
    border-radius: 6px;
  }
  .survey-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 0;
    margin-right: 4px;
  }
  .st-input, .st-textarea, .st-select {
    font-size: 16px;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 8px;
  }
  .st-btn {
    font-size: 13px;
    padding: 8px 14px;
    min-height: 40px;
    border-radius: 6px;
  }
  .pan-lang-field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .pan-lang-field-row label {
    font-size: 14px;
    white-space: normal;
  }
  .full-custom-option {
    padding: 10px 12px;
    font-size: 15px;
  }
  .header-top-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .lang-dropdown-btn {
    font-size: 13px;
    padding: 7px 12px;
    min-height: 38px;
  }
  .lang-dropdown-panel {
    width: 240px;
  }
  .text-xs { font-size: 13px; }
  .text-sm { font-size: 14px; }
  .text-base { font-size: 16px; }
  .text-lg { font-size: 18px; }
}

/* Aligned Option Rows across translation counterparts */
.option-aligned-row {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

/* 2-column internal grid for options when 1 language is active */
.options-2col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px;
}

/* Option Rows & Checkboxes */
.option-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.25;
}
.option-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.survey-checkbox {
  width: 14px;
  height: 14px;
  accent-color: #059669;
  cursor: pointer;
  margin-top: 1px;
  flex-shrink: 0;
}

/* Full-width pan-language text fields */
.pan-lang-field-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pan-lang-field-row label {
  white-space: nowrap;
  flex-shrink: 0;
}

.full-width-field {
  width: 100%;
  flex: 1;
}

.full-custom-option {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card-sub);
  border: 1px dashed var(--border-card);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Form Controls */
.st-input, .st-textarea, .st-select {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  color: var(--text-main);
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.st-input:focus, .st-textarea:focus {
  border-color: var(--accent-en);
}

.st-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-card);
  background: #1e293b;
  color: #e2e8f0;
  transition: all 0.15s ease;
}
.st-btn:hover { background: #334155; }
.st-btn-primary { background: #059669; border-color: #10b981; color: #fff; }
.st-btn-primary:hover { background: #10b981; }
.st-btn-danger { background: #991b1b; border-color: #ef4444; color: #fff; }
.st-btn-danger:hover { background: #dc2626; }

/* Utilities */
.flex-row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.flex-center {
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-emerald { color: var(--accent-en); }
.text-cyan { color: var(--accent-es); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 13px; }
.text-lg { font-size: 15px; }
.italic { font-style: italic; }
