/**
 * Toggle Switch Styles
 * 토글 스위치 컴포넌트 전용 스타일 - 테마 전반에서 사용 가능
 */

/* ===========================================
   기본 토글 스위치
   =========================================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    display: none !important;
}

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

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--theme-main-color);
}

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

/* 포커스 스타일 */
.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(64, 128, 144, 0.2);
}

/* 비활성화 스타일 */
.toggle-switch.disabled,
.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================================
   토글 사이즈 변형
   =========================================== */

/* Small 토글 */
.toggle-switch-sm {
    width: 36px;
    height: 20px;
}

.toggle-switch-sm .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch-sm input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Large 토글 */
.toggle-switch-lg {
    width: 52px;
    height: 28px;
}

.toggle-switch-lg .toggle-slider:before {
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch-lg input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ===========================================
   토글 컬러 변형
   =========================================== */

/* Success 토글 */
.toggle-switch-success input:checked + .toggle-slider {
    background-color: var(--theme-success-color, #28a745);
}

/* Danger 토글 */
.toggle-switch-danger input:checked + .toggle-slider {
    background-color: var(--theme-danger-button-bg, #dc3545);
}

/* Warning 토글 */
.toggle-switch-warning input:checked + .toggle-slider {
    background-color: var(--theme-warning-color, #ffc107);
}

/* ===========================================
   토글 with 라벨
   =========================================== */
.toggle-with-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.toggle-with-label .toggle-label {
    font-size: var(--theme-font-size-body);
    font-family: var(--theme-font-normal);
    color: var(--theme-text-color);
    user-select: none;
}

.toggle-with-label .toggle-label-left {
    order: -1;
}
