/* Custom CSS for WB Hessen Theme */
/* Inherits from Fruity TwentyThree */

body {
    padding-top: 130px !important; /* Reduced from 180px to decrease header gap */
}

@media (max-width: 991px) {
    body {
        padding-top: 100px !important; /* Reduced on mobile */
    }
}

@media (min-width: 992px) {
    /* Hide the top navbar question index when the sidebar is visible */
    #navbar-menu .index-menu-full,
    #navbar-menu .index-menu-incremental {
        display: none !important;
    }
}

/* Centralized Flash Message Styling */
.wb-flash-message-container {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    top: 20px;
    min-width: 320px;
    max-width: 90%;
    transition: opacity 0.5s ease-out;
}

.wb-flash-message-alert {
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175) !important; /* shadow-lg */
    border: 0 !important;
    text-align: center;
    font-weight: 700; /* fw-bold */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom spacing for Yes/No buttons and radios */
.yesno-button.btn-group,
.yesno-button.radio-list {
    gap: 3rem !important; /* Increased spacing */
}

.yesno-button.btn-group .btn {
    border-radius: 0.375rem !important; /* Bootstrap 5 default radius */
    flex: 1;
}

/* Yes/No Button Colors: Green text for Yes, Red text for No when active */
/* Use nth-child to target first (Yes) and second (No) button */
.yesno-button.btn-group .btn:nth-child(1).active {
    background-color: transparent !important;
    border-color: #22c55e !important;
    color: #22c55e !important;
    font-weight: 600 !important;
}

.yesno-button.btn-group .btn:nth-child(2).active {
    background-color: transparent !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    font-weight: 600 !important;
}

/* Fallback: Also target by value attribute */
.yesno-button.btn-group .btn.active[value="Y"],
.yesno-button.btn-group .btn.active[value="1"] {
    background-color: transparent !important;
    border-color: #22c55e !important;
    color: #22c55e !important;
    font-weight: 600 !important;
}

.yesno-button.btn-group .btn.active[value="N"],
.yesno-button.btn-group .btn.active[value="0"] {
    background-color: transparent !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    font-weight: 600 !important;
}

/* Color the radio button circle itself - always black */
.yesno-button.radio-list .answer-item input[type="radio"] {
    accent-color: #000000 !important;
}

/* For Radio buttons (alternative rendering) */
.yesno-button.radio-list .answer-item input[type="radio"][value="Y"]:checked ~ label,
.yesno-button.radio-list .answer-item input[type="radio"][value="1"]:checked ~ label {
    background-color: transparent !important;
    color: #22c55e !important;
    border-color: #22c55e !important;
    font-weight: 600 !important;
}

.yesno-button.radio-list .answer-item input[type="radio"][value="N"]:checked ~ label,
.yesno-button.radio-list .answer-item input[type="radio"][value="0"]:checked ~ label {
    background-color: transparent !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    font-weight: 600 !important;
}

/* Ensure radio items don't have borders or weird backgrounds */
.yesno-button.radio-list .answer-item {
    border: 0 !important;
    margin: 0 !important;
}

/* Force Progress Bar to be blue (WB Primary) */
.progress-bar {
    background-color: #004e92 !important;
    background-image: linear-gradient(to right, #004e92, #007cc3) !important;
}

/* Checkbox styling - ensure checkmark is visible */
input[type="checkbox"],
.form-check-input[type="checkbox"],
.checkbox-item input[type="checkbox"] {
    width: 1.25rem !important;
    height: 1.25rem !important;
    cursor: pointer !important;
    accent-color: #004e92 !important;
    border: 2px solid #6c757d !important;
    border-radius: 0.25em !important;
}

input[type="checkbox"]:checked,
.form-check-input:checked[type="checkbox"],
.checkbox-item input[type="checkbox"]:checked {
    background-color: #004e92 !important;
    border-color: #004e92 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* --- DEBUG: Validation-Hinweise immer sichtbar machen --- */
.em_q_fn_validation,
.em_sq_fn_validation,
.ls-question-message,
.invalid-feedback,
.help-block {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* DEBUG: remove after test */
body::before{
  content:"custom.css LOADED";
  position:fixed; top:0; left:0; z-index:99999;
  background:#000; color:#fff; padding:.25rem .5rem;
  font-size:12px;
}