// Modern Toggle Switch Component
.toggle-container {
    margin-bottom: 1rem;

    &.disabled {
        opacity: 0.6;
        pointer-events: none;
    }

    .toggle-wrapper {
        display: flex;
        align-items: flex-start;
    }

    .toggle-input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;

        &:checked + .toggle-label .toggle-switch {
            background: var(--editor-primary);
            border-color: var(--editor-primary);

            .toggle-slider {
                transform: translateX(100%);
                background: white;
            }
        }

        &:focus + .toggle-label .toggle-switch {
            box-shadow: 0 0 0 3px var(--editor-primary-light);
        }

        &:disabled + .toggle-label {
            cursor: not-allowed;
        }
    }

    .toggle-label {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        cursor: pointer;
        user-select: none;
        width: 100%;
    }

    .toggle-switch {
        position: relative;
        display: inline-block;
        width: 2.75rem;
        height: 1.5rem;
        background: var(--editor-border-dark);
        border: 1px solid var(--editor-border);
        border-radius: 0.75rem;
        transition: var(--editor-transition);
        flex-shrink: 0;
        margin-top: 0.125rem;

        &:hover {
            background: var(--editor-text-muted);
        }

        .toggle-slider {
            position: absolute;
            top: 0.125rem;
            left: 0.125rem;
            width: 1.125rem;
            height: 1.125rem;
            background: white;
            border-radius: 50%;
            transition: var(--editor-transition);
            box-shadow: var(--editor-shadow-sm);
        }
    }

    .toggle-text {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex: 1;
    }

    .toggle-title {
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--editor-text-primary);
        line-height: 1.4;
    }

    .toggle-description {
        font-size: 0.75rem;
        color: var(--editor-text-secondary);
        line-height: 1.3;
    }

    // Size variations
    &.toggle-small {
        .toggle-switch {
            width: 2.25rem;
            height: 1.25rem;
            border-radius: 0.625rem;

            .toggle-slider {
                width: 0.875rem;
                height: 0.875rem;
                top: 0.125rem;
                left: 0.125rem;
            }
        }

        .toggle-title {
            font-size: 0.8125rem;
        }

        .toggle-description {
            font-size: 0.6875rem;
        }
    }

    &.toggle-large {
        .toggle-switch {
            width: 3.25rem;
            height: 1.75rem;
            border-radius: 0.875rem;

            .toggle-slider {
                width: 1.375rem;
                height: 1.375rem;
                top: 0.125rem;
                left: 0.125rem;
            }
        }

        .toggle-title {
            font-size: 1rem;
        }

        .toggle-description {
            font-size: 0.8125rem;
        }
    }
}

// Responsive adjustments
@media (max-width: 768px) {
    .toggle-container {
        .toggle-label {
            gap: 0.5rem;
        }

        .toggle-title {
            font-size: 0.8125rem;
        }

        .toggle-description {
            font-size: 0.6875rem;
        }
    }
}