/* OSCE HCNM Election Survey - Refined Styling (LimeSurvey Compatible) */

/* CSS Variables */
:root {
  --osce-blue: #1e4a72;
  --osce-light-blue: #e8f4f8;
  --osce-hover: #2a5a82;
  --text-dark: #333333;
  --text-muted: #6c757d;
  --background-light: #f8f9fa;
  --border-light: #dee2e6;
}

/* Remove the DEFAULT box issue by being more specific */
.survey-container::before,
.survey-welcome::before {
    display: none !important;
}

/* Only target the main survey title, not other headings */
h1.surveytitle,
.survey-title h1 {
    background: linear-gradient(135deg, var(--osce-blue) 0%, var(--osce-hover) 100%);
    color: white !important;
    padding: 40px 30px;
    text-align: center;
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Survey description - keep minimal */
.survey-description.text-info.text-center {
    font-size: 14px !important;
    color: var(--text-muted) !important;
    padding: 15px 30px !important;
    margin: 0 !important;
    background-color: var(--background-light) !important;
    border: none !important;
    font-style: italic;
}

/* ONLY target the main welcome content, not other elements */
.survey-welcome:not(.ls-privacy-head) {
    padding: 40px !important;
    background-color: white !important;
    border: none !important;
    margin: 0 !important;
}

/* Style welcome content specifically */
.survey-welcome h3:first-child {
    color: var(--osce-blue) !important;
    font-size: 28px !important;
    margin: 0 0 25px 0 !important;
    text-align: center !important;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--osce-blue);
}

.survey-welcome h4 {
    color: var(--osce-blue) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    margin: 30px 0 15px 0 !important;
    padding: 12px 0 12px 15px !important;
    background: linear-gradient(90deg, var(--osce-light-blue) 0%, transparent 100%);
    border-left: 4px solid var(--osce-blue);
    border-radius: 0 8px 8px 0;
}

.survey-welcome p {
    color: var(--text-dark) !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
}

.survey-welcome ul {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 1px solid var(--border-light) !important;
    border-left: 5px solid var(--osce-blue) !important;
    border-radius: 10px !important;
    padding: 25px 30px 25px 45px !important;
    margin: 20px 0 30px 0 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.survey-welcome ol {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border: 1px solid #ffeaa7 !important;
    border-left: 5px solid #ffc107 !important;
    border-radius: 10px !important;
    padding: 25px 30px 25px 45px !important;
    margin: 20px 0 30px 0 !important;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.survey-welcome li {
    margin-bottom: 15px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: var(--text-dark) !important;
}

.survey-welcome em {
    display: block !important;
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%) !important;
    border: 1px solid #ffeaa7 !important;
    border-left: 4px solid #ff6b35 !important;
    color: #856404 !important;
    padding: 20px 25px !important;
    margin: 25px 0 !important;
    border-radius: 8px !important;
    font-style: normal !important;
    font-weight: 500;
}

.survey-welcome em::before {
    content: "⚠️ ";
    margin-right: 8px;
}

/* Fix the spacing issue by targeting the specific LimeSurvey structure */
.survey-welcome + .row,
.survey-welcome + div,
.survey-welcome + p {
    margin-top: 50px !important;
    padding-top: 20px !important;
    border-top: 2px solid #f0f0f0 !important;
}

/* Style the thank you text specifically */
p:contains("Thank you for your participation") {
    font-size: 16px !important;
    color: var(--text-dark) !important;
    margin: 30px 0 !important;
    text-align: left !important;
}

/* Style the signature box without affecting other elements */
.survey-welcome p:last-of-type {
    background: linear-gradient(135deg, var(--osce-light-blue) 0%, #d4edda 100%) !important;
    border: 1px solid var(--osce-blue) !important;
    color: var(--osce-blue) !important;
    padding: 20px !important;
    border-radius: 10px !important;
    text-align: center !important;
    font-weight: 600 !important;
    margin-top: 30px !important;
}

/* Anonymous survey notice - be very specific */
div:contains("This survey is anonymous") h3,
.alert h3,
h3:contains("This survey is anonymous") {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%) !important;
    border: 1px solid #b6d4da !important;
    border-left: 4px solid #17a2b8 !important;
    color: #0c5460 !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    margin: 30px 0 !important;
    font-weight: 500;
    font-size: 18px !important;
}

/* NEXT button styling */
.btn-primary,
button[name="move"],
input[value="NEXT"] {
    background: linear-gradient(135deg, var(--osce-blue) 0%, var(--osce-hover) 100%) !important;
    border: none !important;
    color: white !important;
    padding: 15px 35px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 74, 114, 0.3);
}

.btn-primary::before,
button[name="move"]::before {
    content: "🗳️ ";
    margin-right: 8px;
}

.btn-primary:hover,
button[name="move"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(30, 74, 114, 0.4) !important;
}

/* Question count text */
p:contains("There is 1 question") {
    color: var(--text-muted) !important;
    font-size: 14px !important;
    margin: 20px 0 !important;
    text-align: left !important;
}

/* Voting page styling - only when needed */
.ls-questiongroup h2 {
    background: linear-gradient(135deg, var(--osce-blue) 0%, var(--osce-hover) 100%);
    color: white !important;
    padding: 25px !important;
    margin: 0 !important;
    font-size: 24px;
    text-align: center;
    font-weight: 600;
}

.ls-answers .checkbox-item,
.answer-item {
    background: #f8f9fa !important;
    border: 2px solid var(--border-light) !important;
    border-radius: 8px !important;
    padding: 18px !important;
    margin: 12px 0 !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.ls-answers .checkbox-item:hover,
.answer-item:hover {
    background: var(--osce-light-blue) !important;
    border-color: var(--osce-blue) !important;
    transform: translateX(5px) !important;
}

.ls-answers .checkbox-item:has(input:checked),
.answer-item:has(input:checked) {
    background: var(--osce-light-blue) !important;
    border-color: var(--osce-blue) !important;
    border-width: 3px !important;
}

input[type="checkbox"] {
    transform: scale(1.3) !important;
    margin-right: 12px !important;
    accent-color: var(--osce-blue) !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .survey-welcome {
        padding: 25px 20px !important;
    }
    
    h1.surveytitle {
        font-size: 24px;
        padding: 25px 20px;
    }
    
    .survey-welcome ul,
    .survey-welcome ol {
        padding: 20px 25px 20px 35px !important;
    }
}