/* ========================================
   ATTRACTIVE CHECKBOX & RADIO BUTTON DESIGN
   Modern, Beautiful Form Controls
   ======================================== */

:root {
    --form-primary: #d53f8c;
    --form-primary-dark: #b83280;
    --form-primary-light: #fce4ec;
    --form-success: #28a745;
    --form-border: #e0e0e0;
    --form-border-hover: #d53f8c;
    --form-bg: #ffffff;
    --form-shadow: 0 2px 8px rgba(213, 63, 140, 0.15);
    --form-shadow-hover: 0 4px 12px rgba(213, 63, 140, 0.25);
    --form-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   ENHANCED RADIO BUTTONS
   ======================================== */

/* Custom Radio Button Base Styles */
.radio-option-horizontal input[type="radio"],
.radio-option-inline input[type="radio"],
.option-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    cursor: pointer;
}

/* Radio Circle - Enhanced Design */
.radio-option-horizontal .radio-circle,
.radio-option-inline .radio-circle {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--form-border);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: var(--form-transition);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

/* Radio Circle Hover State */
.radio-option-horizontal:hover .radio-circle,
.radio-option-inline:hover .radio-circle,
.option-box:hover .option-radio + .radio-circle {
    border-color: var(--form-primary);
    background: linear-gradient(135deg, #ffffff 0%, var(--form-primary-light) 100%);
    box-shadow: var(--form-shadow);
    transform: scale(1.1);
}

/* Radio Circle Checked State */
.radio-option-horizontal input[type="radio"]:checked + .radio-circle,
.radio-option-inline input[type="radio"]:checked + .radio-circle,
.radio-option-horizontal.checked .radio-circle,
.radio-option-inline.checked .radio-circle {
    border-color: var(--form-primary);
    background: linear-gradient(135deg, var(--form-primary) 0%, var(--form-primary-dark) 100%);
    box-shadow: var(--form-shadow-hover);
    transform: scale(1.05);
}

/* Radio Circle Inner Dot */
.radio-option-horizontal input[type="radio"]:checked + .radio-circle::after,
.radio-option-inline input[type="radio"]:checked + .radio-circle::after,
.radio-option-horizontal.checked .radio-circle::after,
.radio-option-inline.checked .radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    animation: radioDotAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes radioDotAppear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Assessment Quiz Radio Buttons - Enhanced */
.option-box {
    position: relative;
    overflow: hidden;
}

.option-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--form-primary) 0%, var(--form-primary-dark) 100%);
    transform: scaleY(0);
    transition: var(--form-transition);
    z-index: 1;
}

.option-box.selected::before,
.option-box:hover::before {
    transform: scaleY(1);
}

.option-radio {
    width: 22px;
    height: 22px;
    margin-right: 15px;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    border: 2.5px solid var(--form-border);
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: var(--form-transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.option-radio:hover {
    border-color: var(--form-primary);
    background: linear-gradient(135deg, #ffffff 0%, var(--form-primary-light) 100%);
    box-shadow: var(--form-shadow);
    transform: scale(1.1);
}

.option-radio:checked {
    border-color: var(--form-primary);
    background: linear-gradient(135deg, var(--form-primary) 0%, var(--form-primary-dark) 100%);
    box-shadow: var(--form-shadow-hover);
    transform: scale(1.05);
}

.option-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    animation: radioDotAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   ENHANCED CHECKBOXES
   ======================================== */

/* Custom Checkbox Base Styles */
input[type="checkbox"]:not(.option-radio) {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    cursor: pointer;
}

/* Checkbox Container */
.checkbox-container,
.tracker-checkbox-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* Custom Checkbox Design */
.checkbox-container input[type="checkbox"] + .custom-checkbox,
.tracker-checkbox-option input[type="checkbox"] + .custom-checkbox,
input[type="checkbox"] + .custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--form-border);
    border-radius: 6px;
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: var(--form-transition);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

/* Checkbox Hover State */
.checkbox-container:hover .custom-checkbox,
.tracker-checkbox-option:hover .custom-checkbox,
input[type="checkbox"]:hover + .custom-checkbox {
    border-color: var(--form-primary);
    background: linear-gradient(135deg, #ffffff 0%, var(--form-primary-light) 100%);
    box-shadow: var(--form-shadow);
    transform: scale(1.05);
}

/* Checkbox Checked State */
.checkbox-container input[type="checkbox"]:checked + .custom-checkbox,
.tracker-checkbox-option input[type="checkbox"]:checked + .custom-checkbox,
input[type="checkbox"]:checked + .custom-checkbox {
    border-color: var(--form-primary);
    background: linear-gradient(135deg, var(--form-primary) 0%, var(--form-primary-dark) 100%);
    box-shadow: var(--form-shadow-hover);
    transform: scale(1.05);
}

/* Checkbox Checkmark */
.checkbox-container input[type="checkbox"]:checked + .custom-checkbox::after,
.tracker-checkbox-option input[type="checkbox"]:checked + .custom-checkbox::after,
input[type="checkbox"]:checked + .custom-checkbox::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(1);
    animation: checkmarkAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes checkmarkAppear {
    0% {
        transform: rotate(45deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: rotate(45deg) scale(1.2);
    }
    100% {
        transform: rotate(45deg) scale(1);
        opacity: 1;
    }
}

/* Alternative Checkbox Style - Rounded */
.custom-checkbox.rounded {
    border-radius: 50%;
}

.custom-checkbox.rounded::after {
    border-radius: 50%;
    width: 8px;
    height: 8px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    border: none;
    background: white;
    animation: checkboxDotAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkboxDotAppear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ========================================
   FOCUS STATES FOR ACCESSIBILITY
   ======================================== */

.radio-option-horizontal input[type="radio"]:focus + .radio-circle,
.radio-option-inline input[type="radio"]:focus + .radio-circle,
.option-radio:focus,
.checkbox-container input[type="checkbox"]:focus + .custom-checkbox,
.tracker-checkbox-option input[type="checkbox"]:focus + .custom-checkbox,
input[type="checkbox"]:focus + .custom-checkbox {
    outline: none;
    box-shadow: 0 0 0 4px rgba(213, 63, 140, 0.2);
}

/* ========================================
   DISABLED STATES
   ======================================== */

.radio-option-horizontal input[type="radio"]:disabled + .radio-circle,
.radio-option-inline input[type="radio"]:disabled + .radio-circle,
.option-radio:disabled,
.checkbox-container input[type="checkbox"]:disabled + .custom-checkbox,
.tracker-checkbox-option input[type="checkbox"]:disabled + .custom-checkbox,
input[type="checkbox"]:disabled + .custom-checkbox {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.radio-option-horizontal input[type="radio"]:disabled + .radio-circle:hover,
.radio-option-inline input[type="radio"]:disabled + .radio-circle:hover,
.option-radio:disabled:hover,
.checkbox-container input[type="checkbox"]:disabled + .custom-checkbox:hover,
.tracker-checkbox-option input[type="checkbox"]:disabled + .custom-checkbox:hover,
input[type="checkbox"]:disabled + .custom-checkbox:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ========================================
   LABEL ENHANCEMENTS
   ======================================== */

.radio-option-horizontal,
.radio-option-inline,
.checkbox-container,
.tracker-checkbox-option {
    transition: var(--form-transition);
}

.radio-option-horizontal:hover,
.radio-option-inline:hover,
.checkbox-container:hover,
.tracker-checkbox-option:hover {
    transform: translateX(2px);
}

.radio-option-horizontal:active,
.radio-option-inline:active,
.checkbox-container:active,
.tracker-checkbox-option:active {
    transform: translateX(0);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .radio-circle,
    .custom-checkbox,
    .option-radio {
        width: 20px;
        height: 20px;
    }

    .radio-option-horizontal input[type="radio"]:checked + .radio-circle::after,
    .radio-option-inline input[type="radio"]:checked + .radio-circle::after,
    .option-radio:checked::after {
        width: 8px;
        height: 8px;
    }

    .checkbox-container input[type="checkbox"]:checked + .custom-checkbox::after,
    .tracker-checkbox-option input[type="checkbox"]:checked + .custom-checkbox::after,
    input[type="checkbox"]:checked + .custom-checkbox::after {
        left: 5px;
        top: 1px;
        width: 5px;
        height: 9px;
    }
}

/* ========================================
   SPECIAL VARIATIONS
   ======================================== */

/* Success Color Variant */
.radio-success .radio-circle,
.checkbox-success .custom-checkbox {
    border-color: var(--form-success);
}

.radio-success input[type="radio"]:checked + .radio-circle,
.checkbox-success input[type="checkbox"]:checked + .custom-checkbox {
    background: linear-gradient(135deg, var(--form-success) 0%, #218838 100%);
    border-color: var(--form-success);
}

/* Large Size Variant */
.radio-large .radio-circle,
.checkbox-large .custom-checkbox {
    width: 28px;
    height: 28px;
}

.radio-large input[type="radio"]:checked + .radio-circle::after {
    width: 12px;
    height: 12px;
}

.checkbox-large input[type="checkbox"]:checked + .custom-checkbox::after {
    left: 8px;
    top: 3px;
    width: 7px;
    height: 12px;
}

/* Small Size Variant */
.radio-small .radio-circle,
.checkbox-small .custom-checkbox {
    width: 18px;
    height: 18px;
}

.radio-small input[type="radio"]:checked + .radio-circle::after {
    width: 8px;
    height: 8px;
}

.checkbox-small input[type="checkbox"]:checked + .custom-checkbox::after {
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
}
