/* Dropdown Component Styles */

.dropdown-component-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    padding: 0;
}


#modifier-drawer-container .dropdown-option-item.selected input[type="radio"]::before, .drawer-body-right .dropdown-option-item.selected input[type="radio"]::before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4CAF50 !important;
}

/* Dropdown Item Container */
.dropdown-item-container {
    background: #ffffff;
    border: none;
    border-radius: 0;
    position: relative;
    transition: all 0.3s ease;
}

/* Dropdown Header */
.dropdown-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 1rem;
}

.dropdown-title {
    font-size: 18px;
    font-weight: bold;
    color: rgb(102, 102, 102);
    margin: 0;
}

.dropdown-subtitle {
    font-size: 14px;
    color: #676D77;
    font-weight: 400;
    margin: 0;
    /* margin-bottom: 10px; */
}

/* Inline Required/Optional Text */
.dropdown-inline-required {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 400;
    color: #C24B2C; /* warm orange text */
    background-color: #FDEAE4; /* soft peach background */
    border-radius: 1px;
    vertical-align: middle;
    flex-shrink: 0;
}

.dropdown-inline-optional {
    font-size: 16px;
    color: #676D77;
    font-weight: 400;
}

/* Required Text */
.dropdown-required-text {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    background-color: #F2F4F7;
    color: #676D77;
    margin-top: 8px;
}

/* Selected value span states */
.dropdown-selected-display span.placeholder {
    color: #676D77;
    font-weight: 400;
}

.dropdown-selected-display span.selected {
    color: #000000;
    font-weight: 600;
}

.dropdown-selected-display span.required {
    color: #676D77;
    font-weight: 500;
}

.dropdown-selected-display span.optional {
    color: #676D77;
    font-weight: 400;
}

/* Custom Dropdown Select */
.dropdown-custom-select {
    position: relative;
    width: 100%;
}

.dropdown-selected-display {
    padding: 12px;
    border: 1px solid #000000 !important;
    background-color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: rgb(102, 102, 102);
    transition: all 0.2s ease;
    position: relative;
}

.dropdown-selected-display:hover {
    border-color: #b0b0b0;
}

.dropdown-selected-display.active {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.dropdown-custom-select.active .dropdown-arrow svg {
    transform: rotate(180deg);
}

/* Selected value span */
.dropdown-selected-display span {
    display: block;
}

/* Dropdown arrow positioning */
.dropdown-selected-display .dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* Dropdown Options Container */
.dropdown-options {
    position: relative;
    margin: 1rem 0;
}

/* Dropdown Label */
.dropdown-label {
    font-size: 12px;
    color: #676D77;
    font-weight: 500;
    position: absolute;
    left: 12px;
    top: -10px;
    background-color: #ffffff;
    padding: 0 4px;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

/* Dropdown Arrow */
.dropdown-arrow {
    pointer-events: none;
}

.dropdown-arrow svg {
    transition: transform 0.2s ease;
}

/* Dropdown Options List */
.dropdown-options-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.dropdown-custom-select.active .dropdown-options-list {
    display: block;
}

/* Dropdown Option Items */
.dropdown-option-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dropdown-option-item:last-child {
    border-bottom: none;
}

.dropdown-option-item:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Selected State for Dropdown Option */
.dropdown-option-item.selected {
    background-color: rgba(76, 175, 80, 0.1) !important;
    position: relative;
}

.dropdown-option-item.selected::after {
    content: '✓';
    position: absolute;
    right: 16px;
    color: #4CAF50;
    font-size: 18px;
    font-weight: bold;
}

/* Radio Button Styling */
.dropdown-option-item input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    border: 2px solid #676D77;
    border-radius: 50%;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dropdown-option-item input[type="radio"]:checked {
    border-color: #4CAF50 !important;
    background-color: white !important;
}

.dropdown-option-item input[type="radio"]:checked::before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4CAF50 !important;
}

/* Checkbox Styling for Multi-select */
.dropdown-option-item input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #676D77;
    border-radius: 2px;
    background-color: white;
    cursor: pointer;
    position: relative;
}

.dropdown-option-item input[type="checkbox"]:checked {
    background-color: #676D77;
    border-color: #676D77;
}

.dropdown-option-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.dropdown-option-item label {
    flex: 1;
    cursor: pointer;
    font-size: 16px;
    color: #000000;
    font-weight: 600;
    margin: 0;
}

/* Divider */
.dropdown-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 0 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dropdown-item-container {
        padding: 16px 12px;
    }
    
    .dropdown-title {
        font-size: 16px;
    }
    
    .dropdown-selected-display {
        font-size: 14px;
        padding: 10px;
    }
    
    .dropdown-option-item {
        padding: 10px 12px;
    }
    
    .dropdown-option-item label {
        font-size: 14px;
    }
    
    .dropdown-options-list {
        max-height: 180px;
    }
}

@media (max-width: 480px) {
    .dropdown-title {
        font-size: 14px;
    }
    
    .dropdown-subtitle {
        font-size: 13px;
    }
    
    .dropdown-selected-display {
        font-size: 13px;
        padding: 8px;
    }
    
    .dropdown-option-item {
        padding: 8px 10px;
    }
    
    .dropdown-option-item label {
        font-size: 13px;
    }
    
    .dropdown-options-list {
        max-height: 150px;
    }
}

/* Focus States for Accessibility */
.dropdown-select:focus-visible {
    outline: none;
    outline-offset: 2px;
}

/* Hover States */
.dropdown-select:hover {
    background-color: #fafafa;
}

/* Selected State */
.dropdown-select:not([value=""]) {
    color: #000000;
    font-weight: 600;
}

/* Placeholder State */
.dropdown-select[value=""] {
    color: #676D77;
    font-weight: 400;
}

/* Animation for dropdown opening */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-options {
    animation: dropdownFadeIn 0.2s ease-out;
}

/* Higher specificity for modifier drawer context */
#modifier-drawer-container .dropdown-option-item input[type="radio"],
.drawer-body-right .dropdown-option-item input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid #676D77;
    border-radius: 50%;
    background-color: white;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

#modifier-drawer-container .dropdown-option-item input[type="radio"]:checked,
.drawer-body-right .dropdown-option-item input[type="radio"]:checked {
    border-color: #4CAF50 !important;
    background-color: white !important;
}

#modifier-drawer-container .dropdown-option-item input[type="radio"]:checked::before,
.drawer-body-right .dropdown-option-item input[type="radio"]:checked::before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4CAF50 !important;
}
