/* ============================================================
   survey.css
   www/stylesheets/survey.css
   ============================================================ */

/* -- Survey page wrapper ----------------------------------- */
.survey-page {
    padding: 30px 0;
}

.survey-page h1 {
    color: #FF0000;
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.survey-page .survey-subtitle {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* -- Wider container for transactional survey -------------- */
.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* -- Progress bar ------------------------------------------ */
.progress-bar {
    background: #ddd;
    border-radius: 4px;
    height: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-bar-fill {
    background: #FF0000;
    height: 100%;
    transition: width 0.3s ease;
}

/* -- Two column layout: sidebar + main --------------------- */
.survey-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* -- Left sidebar ------------------------------------------ */
.survey-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 20px;
}

/* One continuous white panel for the entire sidebar */
.sidebar-panel {
    background: #fff;
    border-radius: 6px;
    box-shadow: none;
}

.sidebar-ranking-key {
    padding: 14px 16px 10px 16px;
    font-size: 0.85rem;
}

.sidebar-ranking-key h4 {
    color: #FF0000;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-ranking-key ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-ranking-key ul li {
    padding: 3px 0;
    line-height: 1.4;
    color: #333;
}

.sidebar-image {
    width: 100%;
    height: auto;
    display: block;
}

/* -- Main question area ------------------------------------ */
.survey-main {
    flex: 1;
    min-width: 0;
}

/* -- Personal details section ------------------------------ */
.personal-details {
    background: #fff;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.personal-details h2 {
    font-size: 1.05rem;
    color: #FF0000;
    margin-bottom: 14px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #FF0000;
    box-shadow: 0 0 0 2px rgba(255,0,0,0.15);
}

/* -- Individual question block ----------------------------- */
.question-block {
    background: #fff;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.question-header {
    font-weight: bold;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

/* -- Sub-question rows: text on left, ABCD on right -------- */
.subquestion-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.subquestion-row:last-child {
    border-bottom: none;
}

.subquestion-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* -- A B C D button group ---------------------------------- */
.abcd-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.abcd-btn {
    width: 38px;
    height: 38px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    color: #555;
}

.abcd-btn:hover:not(:disabled) {
    border-color: #FF0000;
    color: #FF0000;
}

.abcd-btn.selected {
    background: #FF0000;
    border-color: #FF0000;
    color: #fff;
}

.abcd-btn.unavailable {
    opacity: 0.25;
    cursor: not-allowed;
}

/* -- Error states ------------------------------------------ */
.question-block.has-error {
    border: 2px solid #CC0000;
}

.error-banner {
    background: #fff0ee;
    border: 1px solid #CC0000;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #CC0000;
    font-size: 0.9rem;
}

.error-banner ul {
    margin: 8px 0 0 16px;
}

/* -- Form navigation --------------------------------------- */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
}

.btn-next {
    background: #FF0000;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-next:hover {
    background: #CC0000;
}

.btn-back {
    background: #777;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-back:hover {
    background: #555;
}

/* -- Responsive -------------------------------------------- */
@media (max-width: 700px) {
    .survey-layout {
        flex-direction: column;
    }

    .survey-sidebar {
        width: 100%;
    }

    .sidebar-sticky {
        position: static;
    }

    .sidebar-ranking-key ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* -- Transactional survey specific ------------------------- */

/* Sidebar driver images */
.trans-sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 15px;
    background: #F5F5F5;
}

.trans-sidebar-label {
    font-size: 0.78rem;
    font-weight: bold;
    color: #000;
    text-align: center;
    width: 100%;
    padding: 4px 0 15px 0;
}

/* Dropdown row layout */
.trans-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.trans-row:last-child {
    border-bottom: none;
}

.trans-dropdown {
    flex-shrink: 0;
    min-width: 140px;
}

.trans-select {
    width: 100%;
    padding: 7px 10px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s;
}

.trans-select:focus {
    outline: none;
    border-color: #FF0000;
}

.trans-select.select-error {
    border-color: #CC0000;
    background: #fff8f8;
}
