:root {
    --primary-color: #0056b3;
    --secondary-color: #f0f4f8;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: #f9f9f9;
    margin: 0;
    line-height: 1.6;
    font-size: 14px; /* User requested relatively small font */
}

/* Header */
.main-header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.visual-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.logo {
    font-size: 1.4rem;
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    letter-spacing: -0.5px;
}

/* Search Area */
.search-wrapper {
    display: flex;
    align-items: center;
    max-width: 400px;
    width: 100%;
}

.search-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 20px 0 0 20px;
    padding: 2px 10px;
    background: white;
    flex-grow: 1;
    min-height: 30px;
}

#site-search {
    border: none;
    outline: none;
    flex-grow: 1;
    font-size: 0.9rem;
    min-width: 100px;
    height: 24px;
    margin: 2px 0;
}

#search-btn {
    height: 36px; /* DO NOT CHANGE THIS VALUE FOR ANY REASON */
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-left: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search Tags */
.search-tag {
    background-color: #e0e0e0;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.85rem;
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
}

.search-tag-close {
    margin-left: 5px;
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

.search-tag-close:hover {
    color: #333;
}


/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Progress Bar */
.progress-container {
    margin: 30px 0;
    scroll-margin-top: 140px; /* Buffer for sticky header + spacing */
}

.progressbar {
    counter-reset: step;
    padding: 0;
    display: flex;
    justify-content: space-between;
    list-style-type: none;
}

.progressbar li {
    flex: 1;
    text-align: center;
    position: relative;
    font-size: 0.85rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer; /* Clickable */
}

.progressbar li:before {
    content: counter(step);
    counter-increment: step;
    width: 30px;
    height: 30px;
    line-height: 28px;
    display: block;
    font-size: 14px;
    color: #333;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin: 0 auto 10px auto;
    font-weight: bold;
}

.progressbar li:after {
    content: '';
    width: 100%;
    height: 2px;
    background: var(--border-color);
    position: absolute;
    left: -50%;
    top: 15px;
    z-index: -1;
}

.progressbar li:first-child:after {
    content: none;
}

.progressbar li.active {
    color: var(--primary-color);
    font-weight: 600;
}

.progressbar li.active:before {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Steps */
.step {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    animation: fadeIn 0.5s;
}

.step.active-step {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

h3 {
    color: #444;
    margin-top: 15px;
}

/* Content Blocks */
.content-block {
    margin-bottom: 15px;
}

.intro-box {
    background-color: #eef5fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
}

.cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.success-block {
    background-color: #eef5fa; /* Light Blue */
    padding: 20px;
    border-radius: 8px;
}

.warning-block {
    background-color: #fff5f5; /* Very Light Red */
    padding: 20px;
    border-radius: 8px;
}

/* Accordion */
details {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

summary {
    padding: 15px;
    background: #fcfcfc;
    cursor: pointer;
    font-weight: 500;
    list-style: none; /* Hide default triangle */
    position: relative;
}

summary::-webkit-details-marker {
    display: none;
}

summary:after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 1.2rem;
    color: #777;
}

body.visual-mode .interactive-card summary:after {
    display: none;
}

details[open] summary:after {
    content: '-';
}

details[open] summary {
    border-bottom: 1px solid var(--border-color);
}

details ul {
    padding: 15px 40px;
    margin: 0;
}

/* Accordion Content Layout for Visual Mode */
.accordion-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 15px;
}

body.text-mode .accordion-content {
    display: block;
}

.accordion-visual {
    flex: 0 0 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accordion-visual img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.accordion-text {
    flex: 1;
}

/* --- Interactive Cards (Benefits/Risks) --- */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.interactive-card {
    flex: 1 1 250px; /* Responsive flex basis */
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: transparent; /* Remove white background */
    border: none; /* Remove border */
    box-shadow: none; /* Remove shadow */
    overflow: visible; /* Prevent clipping */
}

.interactive-card summary {
    padding: 0;
    background: transparent;
    border: none;
}

.interactive-card[open] summary {
    border-bottom: none;
}

.visual-card-header {
    display: none;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: transparent; /* Remove white background */
    transition: transform 0.2s;
}

.visual-card-header:hover {
    transform: translateY(-5px);
}

.visual-card-header img {
    width: 100%;
    height: 150px;
    object-fit: contain; /* Changed from 'cover' to 'contain' */
    display: block;
    border-radius: 8px;
}

.card-plus-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.interactive-card[open] .card-plus-icon {
    background: var(--primary-color);
    color: white;
    transform: rotate(45deg);
}

.text-card-header {
    display: block;
    padding: 15px;
    background: white; /* Keep white for text bars for contrast */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-content {
    padding: 10px 0;
    background: transparent; /* Remove white background */
    border: none; /* Remove border */
    border-top: none;
    border-radius: 0;
    margin-top: 0;
}

body.visual-mode .visual-card-header {
    display: block;
}
body.visual-mode .text-card-header {
    display: none;
}
body.text-mode .visual-card-header {
    display: none;
}
body.text-mode .text-card-header {
    display: flex;
}

/* Sliders */
.slider-group {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.slider-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 10px;
    min-height: 30px;
}

.slider-wrapper::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    z-index: 0;
}

.ticks-container {
    position: absolute;
    top: 10px;
    width: 100%;
    height: 8px;
    z-index: 1;
    pointer-events: none;
}

.tick-mark-25, .tick-mark-50, .tick-mark-75 {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 160%;
    border-radius: 999px;
    background-color: #afafaf;
}

.tick-mark-25 { left: 25%; }
.tick-mark-50 { left: 50%; }
.tick-mark-75 { left: 75%; }

.value-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    margin-top: 10px;
    z-index: 2;
    position: relative;
    height: 8px;
    cursor: pointer;
}

.value-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    margin-top: -4px;
    position: relative;
    z-index: 3;
}

.value-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    border: none;
    position: relative;
    z-index: 3;
}

/* Slider Labels */
.label-left, .label-right {
    flex: 0 0 20%;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}
.label-left { text-align: right; }
.label-right { text-align: left; }

/* Quiz & Decision Card Styles */
.quiz-question, .decision-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quiz-question .question-text, .decision-card h3 {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: 0;
}

/* Radio Option Styling (Cards) */
.quiz-question label, .radio-card, .radio-group-vertical label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fcfcfc;
    transition: all 0.2s ease;
    text-align: left;
}

.quiz-question label:hover, .radio-card:hover, .radio-group-vertical label:hover {
    background: #f0f8ff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.radio-card input, .quiz-question label input, .radio-group-vertical label input {
    margin-right: 12px;
}

/* Horizontal Radio Groups */
.radio-group-horizontal {
    display: flex;
    gap: 15px;
    margin-bottom: 0;
}

.radio-group-horizontal .radio-card {
    flex: 1;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 15px;
}

.radio-group-horizontal .radio-card input {
    margin-right: 0;
    margin-bottom: 10px;
}

.text-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #444;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    background-color: #fdfdfd;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    background-color: white;
}

/* Quiz Feedback */
.feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
}

.feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none;
}


/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.slider-thumb {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #2196F3;
}

.switch input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

.switch input:checked + .slider + .slider-thumb {
  transform: translateX(20px);
}

body.text-mode .visual-mode-only {
    display: none !important;
}
body.text-mode .text-mode-only {
    display: block !important;
}
body.visual-mode .text-mode-only {
    display: none !important;
}
body.visual-mode .visual-mode-only {
    display: block !important;
}

/* Nav Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #004494;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Disabled state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Summary Box */
.copy-box {
    background: #f4f4f4;
    padding: 20px;
    border: 2px dashed #999;
    margin-top: 25px;
    border-radius: 8px;
}

.copy-box h4 {
    margin-top: 0;
    color: #444;
}

/* Summary Blue Headings */
.summary-section h4, 
.summary-section strong {
    color: var(--primary-color);
}

/* References Padding */
.references-list {
    background: white;
    padding: 30px;
    margin-top: 15px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #ddd;
    line-height: 1.8;
}

/* Feedback Popup */
.feedback-popup {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.feedback-popup:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.feedback-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.feedback-popup .close-btn {
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-weight: 300;
}

.feedback-popup .close-btn:hover {
    opacity: 1;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    body {
        font-size: 13px;
        line-height: 1.5;
    }

    .container {
        padding: 0 12px;
    }

    .logo {
        font-size: 1.2rem !important; /* Smaller logo for mobile */
    }

    /* Header Grid Layout */
    .header-content {
        display: flex;
        flex-direction: column;
        justify-items: baseline;
        /* align-items: start; */
        gap: 4px;
    }

    .header-controls {
        display: flex;
        flex-direction: column;
        gap: 2px !important;
    }

    /* Row 1, Col 1: Logo */
    .logo-btn {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        text-align: left;
    }

    .logo {
        font-size: 0.95rem; /* Slightly smaller for better fit */
        text-align: left;
        margin-bottom: 0;
        line-height: 1.2;
    }

    /* Row 1, Col 2: Toggle */
    .visual-toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        font-size: 0.75rem;
        transform: scale(0.9);
        transform-origin: right center;
        white-space: nowrap;
        gap: 5px;
    }

    /* Row 2, Full Width: Search */
    .search-wrapper {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 5px;
    }

    .search-container {
        min-height: 30px;
        flex-grow: 1;
        max-width: 100%;
    }

    #site-search {
        height: 20px;
        font-size: 0.85rem;
    }

    #search-btn {
        height: 28px;
        padding: 0 10px;
    }

    /* Compact Headings */
    h2 { font-size: 1.3rem; margin-bottom: 15px; }
    h3 { font-size: 1.1rem; margin-top: 20px; }

    textarea {
        padding: 8px 15px 15px 15px; /* Adjust top padding for text input boxes */
    }

    /* Sliders Stack (Preserved & Compact) */
    .slider-container {
        flex-direction: column;
        gap: 5px;
        align-items: stretch;
        margin-bottom: 10px;
    }

    .slider-wrapper {
        width: 100%;
        padding: 0 10px;
        margin: 5px 0;
    }

    .label-left, .label-right {
        flex: auto;
        width: 100%;
        text-align: center;
        font-size: 0.8rem;
        margin: 0;
    }
    
    .label-left { order: -1; } /* Ensure left label is on top */
    .label-right { order: 1; }  /* Right label on bottom */

    /* Radio Horizontal to Vertical */
    .radio-group-horizontal {
        flex-direction: column;
        gap: 8px;
    }

    .radio-group-horizontal .radio-card {
        padding: 10px;
        flex-direction: row;
        text-align: left;
        justify-content: flex-start;
        min-height: auto;
    }

    .radio-group-horizontal .radio-card input {
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .step {
        padding: 15px; /* Compact padding */
    }

    .progressbar li {
        font-size: 0.7rem;
    }
    
    .progressbar li:before {
        width: 24px;
        height: 24px;
        line-height: 22px;
        font-size: 12px;
        margin-bottom: 5px;
    }

    .cols-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .intro-box, .content-block {
        padding: 5px;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 600px) {
    .accordion-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .accordion-visual {
        flex: none;
        width: 100%;
        max-width: 200px;
        margin-bottom: 15px;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
    
    .nav-buttons div {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}